@botpress/adk-cli 1.19.0-beta.4 → 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.
Files changed (65) hide show
  1. package/dist/{README-wjb7z7f0.md → README-824wa4jj.md} +1 -1
  2. package/dist/SKILL-75ym6tcj.md +257 -0
  3. package/dist/SKILL-chnwzmt1.md +548 -0
  4. package/dist/SKILL-d4bs53y3.md +244 -0
  5. package/dist/SKILL-h4b2f1n9.md +114 -0
  6. package/dist/SKILL-hbw5nt95.md +111 -0
  7. package/dist/actions-h7hxxvxr.md +823 -0
  8. package/dist/adk-build-emhwd0tg.md +39 -0
  9. package/dist/adk-debug-yrrdtpmb.md +23 -0
  10. package/dist/adk-dev-console-7z9rtjpy.md +17 -0
  11. package/dist/adk-document-ras6zzzh.md +68 -0
  12. package/dist/adk-eval-vx76dwq0.md +17 -0
  13. package/dist/adk-explain-fcsaw852.md +22 -0
  14. package/dist/adk-init-9kmxmbbe.md +30 -0
  15. package/dist/adk-ship-dybzn884.md +29 -0
  16. package/dist/adk-test-xq67savs.md +27 -0
  17. package/dist/adk-validate-1p4skv4m.md +31 -0
  18. package/dist/advanced-patterns-z86m9h1a.md +669 -0
  19. package/dist/agent-config-1aqvkrgf.md +450 -0
  20. package/dist/agent-steps-zj4c1n9t.md +115 -0
  21. package/dist/assets-q7jt8r2q.md +237 -0
  22. package/dist/autonomous-execution-fymc12e5.md +747 -0
  23. package/dist/cli-c31e06yr.md +1334 -0
  24. package/dist/cli.js +970 -566
  25. package/dist/commands.json +24 -3
  26. package/dist/common-failures-ht29w2db.md +231 -0
  27. package/dist/component-registry-bbpw0see.md +43 -0
  28. package/dist/context-api-760cvh0h.md +461 -0
  29. package/dist/conversation-analysis-8ka4nrm4.md +420 -0
  30. package/dist/conversation-lifecycle-4seqqjc1.md +311 -0
  31. package/dist/conversations-gwfvxaee.md +1111 -0
  32. package/dist/custom-components-y5wdgpey.md +167 -0
  33. package/dist/debug-workflow-vz84q80v.md +239 -0
  34. package/dist/desk-k54ktvsd.md +852 -0
  35. package/dist/doc-standards-ck6ax2jd.md +124 -0
  36. package/dist/eval-format-7n9brja4.md +354 -0
  37. package/dist/evals-y1zcr1mc.md +11 -0
  38. package/dist/explain-config-1yaq3zzd.md +424 -0
  39. package/dist/files-dzt0wxn3.md +918 -0
  40. package/dist/integration-actions-xang7tma.md +659 -0
  41. package/dist/integrations-k5ss07f4.md +266 -0
  42. package/dist/interfaces-6t0bpxs4.md +97 -0
  43. package/dist/knowledge-bases-20rg8p5c.md +456 -0
  44. package/dist/llm-debugging-76ng8rzm.md +209 -0
  45. package/dist/mcp-server-n1asyzhv.md +112 -0
  46. package/dist/messages-gkkg0b54.md +769 -0
  47. package/dist/model-configuration-f273kgd0.md +201 -0
  48. package/dist/multi-agent-dashboard-1mdfjdts.md +70 -0
  49. package/dist/pages-xn18xn73.md +273 -0
  50. package/dist/patterns-mistakes-5vb99dhf.md +469 -0
  51. package/dist/plugins-ttnx8f49.md +280 -0
  52. package/dist/tables-x45t36dd.md +1136 -0
  53. package/dist/tags-46td3qrg.md +516 -0
  54. package/dist/test-patterns-hj47w4nc.md +355 -0
  55. package/dist/testing-workflow-2vkp932f.md +225 -0
  56. package/dist/tools-wk7bq24z.md +581 -0
  57. package/dist/trace-summarization-hdyx1c2e.md +313 -0
  58. package/dist/traces-and-logs-f2kjfh19.md +203 -0
  59. package/dist/triggers-4j2cc86x.md +719 -0
  60. package/dist/ui-server-entry.js +952 -137
  61. package/dist/workflow-steps-mrdrf1c5.md +851 -0
  62. package/dist/workflows-gadx3s69.md +1408 -0
  63. package/dist/zai-agent-reference-e6644aad.md +454 -0
  64. package/dist/zai-complete-guide-mnna5d6f.md +1408 -0
  65. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -36942,7 +36942,7 @@ var require_jsx_dev_runtime = __commonJS((exports, module) => {
36942
36942
  });
36943
36943
 
36944
36944
  // src/utils/build-constants.ts
36945
- var CLI_VERSION = "1.19.0-beta.4", EXPECTED_RUNTIME_VERSION = "1.19.0-beta.4", MIN_SUPPORTED_RUNTIME = "1.17.0", IS_RELEASE_BUILD = false;
36945
+ var CLI_VERSION = "1.19.0-beta.5", EXPECTED_RUNTIME_VERSION = "1.19.0-beta.5", MIN_SUPPORTED_RUNTIME = "1.17.0", IS_RELEASE_BUILD = false;
36946
36946
 
36947
36947
  // ../../node_modules/.bun/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js
36948
36948
  var require_lib = __commonJS((exports) => {
@@ -364769,7 +364769,7 @@ var init_internal = __esm(() => {
364769
364769
  });
364770
364770
  init_define_PACKAGE_VERSIONS = __esm2({
364771
364771
  "<define:__PACKAGE_VERSIONS__>"() {
364772
- define_PACKAGE_VERSIONS_default = { runtime: "1.19.0-beta.4", adk: "not-installed", sdk: "6.11.1", llmz: "0.0.78", zai: "2.6.21", cognitive: "0.5.4" };
364772
+ define_PACKAGE_VERSIONS_default = { runtime: "1.19.0-beta.5", adk: "not-installed", sdk: "6.11.1", llmz: "0.0.78", zai: "2.6.21", cognitive: "0.5.4" };
364773
364773
  }
364774
364774
  });
364775
364775
  init_eval = __esm2({
@@ -671415,7 +671415,7 @@ var init_library2 = __esm(() => {
671415
671415
  });
671416
671416
  init_define_PACKAGE_VERSIONS2 = __esm3({
671417
671417
  "<define:__PACKAGE_VERSIONS__>"() {
671418
- define_PACKAGE_VERSIONS_default2 = { runtime: "1.19.0-beta.4", adk: "not-installed", sdk: "6.11.1", llmz: "0.0.78", zai: "2.6.21", cognitive: "0.5.4" };
671418
+ define_PACKAGE_VERSIONS_default2 = { runtime: "1.19.0-beta.5", adk: "not-installed", sdk: "6.11.1", llmz: "0.0.78", zai: "2.6.21", cognitive: "0.5.4" };
671419
671419
  }
671420
671420
  });
671421
671421
  init_assets2 = __esm3({
@@ -766139,7 +766139,7 @@ var init_definition3 = __esm(() => {
766139
766139
  });
766140
766140
  init_define_PACKAGE_VERSIONS3 = __esm5({
766141
766141
  "<define:__PACKAGE_VERSIONS__>"() {
766142
- define_PACKAGE_VERSIONS_default3 = { runtime: "1.19.0-beta.4", adk: "not-installed", sdk: "6.11.1", llmz: "0.0.78", zai: "2.6.21", cognitive: "0.5.4" };
766142
+ define_PACKAGE_VERSIONS_default3 = { runtime: "1.19.0-beta.5", adk: "not-installed", sdk: "6.11.1", llmz: "0.0.78", zai: "2.6.21", cognitive: "0.5.4" };
766143
766143
  }
766144
766144
  });
766145
766145
  init_transcript3 = __esm5({
@@ -836754,7 +836754,7 @@ var init_runtime6 = __esm(() => {
836754
836754
  });
836755
836755
  init_define_PACKAGE_VERSIONS4 = __esm6({
836756
836756
  "<define:__PACKAGE_VERSIONS__>"() {
836757
- define_PACKAGE_VERSIONS_default4 = { runtime: "1.19.0-beta.4", adk: "not-installed", sdk: "6.11.1", llmz: "0.0.78", zai: "2.6.21", cognitive: "0.5.4" };
836757
+ define_PACKAGE_VERSIONS_default4 = { runtime: "1.19.0-beta.5", adk: "not-installed", sdk: "6.11.1", llmz: "0.0.78", zai: "2.6.21", cognitive: "0.5.4" };
836758
836758
  }
836759
836759
  });
836760
836760
  init_globals4 = __esm6({
@@ -903591,7 +903591,7 @@ ${names || " (none found)"}`);
903591
903591
  async copyTemplateFiles(templateDir) {
903592
903592
  const substitutions = {
903593
903593
  "{{projectName}}": this.projectName,
903594
- "{{runtimeVersion}}": "1.19.0-beta.4",
903594
+ "{{runtimeVersion}}": "1.19.0-beta.5",
903595
903595
  "{{packageManager}}": this.packageManager
903596
903596
  };
903597
903597
  await this.copyDirRecursive(templateDir, this.projectPath, substitutions);
@@ -909247,11 +909247,11 @@ var semver2, import_ts_morph, import_debug, semver22, import_ts_morph2, import_t
909247
909247
  `));
909248
909248
  return code;
909249
909249
  }
909250
- }, ADK_VERSION = "1.19.0-beta.4", relative4 = (from, to6) => {
909250
+ }, ADK_VERSION = "1.19.0-beta.5", relative4 = (from, to6) => {
909251
909251
  const fromDir = path142.dirname(from);
909252
909252
  const relative22 = path142.relative(fromDir, to6);
909253
909253
  return relative22.startsWith(".") ? relative22 : `./${relative22}`;
909254
- }, init_utils11 = () => {}, require_chat_bundle, exports_action_types, init_action_types, exports_integration_action_types, init_integration_action_types, require_package3, exports_dependencies, FRIENDLY_ALIAS_RE, BP_INTERNAL_ID_PREFIXES, debug2, BP_CLI_VERSION = "6.8.1", BP_CLI_INSTALL_ALL, BP_CLI_INSTALL_DIR, BP_CLI_BIN_PATH, BP_CLIENT_ENV_KEYS, BpAddCommand, BpBuildCommand, BpDeployCommand, REQUEST_HANDLING_ERROR_MARKER, BpDevCommand, BpChatCommand, workspaceCache, chatBundle, RUNTIME_MODULE = "@botpress/runtime", RUNTIME_NAMED = "CustomComponent", FileWatcher, ai_assistant_instructions_template_default = "# Botpress ADK Agent\n\n> This project is built with the **Botpress Agent Development Kit (ADK)** \u2014 a TypeScript-first framework for building AI agents.\n\n## Key Files\n\n- `agent.config.ts` \u2014 Agent configuration, models, and state schemas\n- `dependencies.dev.lock.json` \u2014 Lock file for dev environment integrations/plugins (source of truth for installed dependencies)\n- `dependencies.prod.lock.json` \u2014 Lock file for prod environment (created after first deploy)\n- `src/conversations/` \u2014 Message handlers (primary user interaction)\n- `src/workflows/` \u2014 Long-running background processes\n- `src/tools/` \u2014 AI-callable functions\n- `src/actions/` \u2014 Reusable business logic\n- `src/knowledge/` \u2014 RAG knowledge base sources\n- `src/tables/` \u2014 Database table definitions\n- `src/triggers/` \u2014 Event-based triggers\n\n## Development\n\n```bash\nadk dev # Start dev server with hot reload\nadk build # Build and generate types\nadk deploy # Deploy to Botpress Cloud\nadk chat # Chat with your agent in the terminal\n```\n\n## CLI Commands (preferred interface)\n\nUse CLI commands with `--format json` for structured output.\n\n### Debugging & Testing\n\n| Command | Use for |\n| --------------------------------------------- | ---------------------------------------------------------------------------------------- |\n| `adk check --format json` | Offline project validation \u2014 catch config and schema errors |\n| `adk chat --single \"<message>\" --format json` | Test messages to the running bot (use --conversation-id <id> to continue a conversation) |\n| `adk logs [error\\|warning] --format json` | Query dev server logs, build output, and errors |\n| `adk traces [filters...] --format json` | Query trace spans for debugging conversations/workflows |\n| `adk status --format json` | Get project info: name, primitives, and integrations |\n\n### Dependencies (Integrations & Plugins)\n\nManage dependencies through the `adk integrations` / `adk plugins` CLI commands or the Integrations view in the dev console \u2014 never by editing lock files directly. The lock files (`dependencies.dev.lock.json` / `dependencies.prod.lock.json`) are a best-effort mirror of cloud state, kept in sync automatically by the CLI; edit them only as a last resort.\n\n**Integrations** (external services: Slack, webchat, etc.)\n\n| Command | Use for |\n| ------------------------------------ | -------------------------------------------------------- |\n| `adk integrations add <name>` | Add an integration (updates lock file) |\n| `adk integrations remove <name>` | Remove an integration |\n| `adk integrations list` | List installed integrations |\n| `adk integrations search <query>` | Search available integrations on the Botpress Hub |\n| `adk integrations info <name>` | Get detailed info about an integration |\n| `adk integrations pull-lock [--env]` | Pull current cloud state into the lock file |\n| `adk integrations push-lock [--env]` | Push the lock file to cloud (apply lock to bot) |\n| `adk integrations diff [--env]` | Show differences between lock and cloud |\n| `adk integrations copy --from --to` | Copy integration state between dev and prod environments |\n\n**Plugins** (reusable bot capabilities)\n\n| Command | Use for |\n| ------------------------------- | ------------------------------------------- |\n| `adk plugins add <name>` | Add a plugin (updates lock file) |\n| `adk plugins remove <name>` | Remove a plugin |\n| `adk plugins list` | List installed plugins |\n| `adk plugins search <query>` | Search available plugins |\n| `adk plugins info <name>` | Get detailed info about a plugin |\n| `adk plugins pull-lock [--env]` | Pull current cloud state into the lock file |\n| `adk plugins push-lock [--env]` | Push the lock file to cloud |\n| `adk plugins diff [--env]` | Show differences between lock and cloud |\n| `adk plugins copy --from --to` | Copy plugin state between dev and prod |\n\n> **Note:** `adk add`, `adk remove`, `adk list`, `adk search`, `adk info` are deprecated aliases \u2014 use `adk integrations <command>` or `adk plugins <command>` instead.\n\n### Workflows\n\n| Command | Use for |\n| ---------------------------------------------------- | -------------------------------------------------- |\n| `adk workflows list --format json` | Discover available workflows |\n| `adk workflows inspect <name> --format json` | Get workflow input schema |\n| `adk workflows run <name> '<payload>' --format json` | Execute a workflow |\n| `adk workflows runs [filters] --format json` | List workflow runs |\n| `adk workflows runs <wrkflow_id> --format json` | Inspect a single run (status + state + step cache) |\n\n> **Tip:** The dev server must be running (`adk dev`) for testing and trace tools to work.\n\n### Skills\n\nFor detailed ADK documentation, install the skills (use `bunx` if `bun.lockb` exists, otherwise `npx`): `bunx skills add botpress/skills -s '*' -a codex claude-code -y`. Available skills: `adk`, `adk-debugger`, `adk-evals`, `adk-integrations`, `adk-frontend` & more.\n\n## Project Overview\n\n<!-- Describe what your agent does -->\n\n## Architecture & Conventions\n\n<!-- Add project-specific patterns, decisions, and conventions -->\n\n## Notes\n\n<!-- Add anything else relevant to your project -->\n", TEXT_EXTENSIONS, DEPLOYED_AGENT_MANIFEST_SCHEMA_VERSION = 1, DEPLOYED_AGENT_MANIFEST_FILE_KEY = ".adk/deployed-agent-manifest.json", ADK_MANIFEST_BOT_TAGS, DEPLOYED_AGENT_MANIFEST_TAGS, deployedAgentManifestPrimitiveSchema, deployedAgentManifestSchema, transforms, getIntegrationHash = (integration) => {
909254
+ }, init_utils11 = () => {}, require_chat_bundle, exports_action_types, init_action_types, exports_integration_action_types, init_integration_action_types, require_package3, exports_dependencies, FRIENDLY_ALIAS_RE, BP_INTERNAL_ID_PREFIXES, debug2, BP_CLI_VERSION = "6.8.1", BP_CLI_INSTALL_ALL, BP_CLI_INSTALL_DIR, BP_CLI_BIN_PATH, BP_CLIENT_ENV_KEYS, BpAddCommand, BpBuildCommand, BpDeployCommand, REQUEST_HANDLING_ERROR_MARKER, BpDevCommand, BpChatCommand, workspaceCache, chatBundle, RUNTIME_MODULE = "@botpress/runtime", RUNTIME_NAMED = "CustomComponent", FileWatcher, ai_assistant_instructions_template_default = "# Botpress ADK Agent\n\n> This project is built with the **Botpress Agent Development Kit (ADK)** \u2014 a TypeScript-first framework for building AI agents.\n\n## Key Files\n\n- `agent.config.ts` \u2014 Agent configuration, models, and state schemas\n- `dependencies.dev.lock.json` \u2014 Lock file for dev environment integrations/plugins (source of truth for installed dependencies)\n- `dependencies.prod.lock.json` \u2014 Lock file for prod environment (created after first deploy)\n- `src/conversations/` \u2014 Message handlers (primary user interaction)\n- `src/workflows/` \u2014 Long-running background processes\n- `src/tools/` \u2014 AI-callable functions\n- `src/actions/` \u2014 Reusable business logic\n- `src/knowledge/` \u2014 RAG knowledge base sources\n- `src/tables/` \u2014 Database table definitions\n- `src/triggers/` \u2014 Event-based triggers\n\n## Development\n\n```bash\nadk dev # Start dev server with hot reload\nadk build # Build and generate types\nadk deploy # Deploy to Botpress Cloud\nadk chat # Chat with your agent in the terminal\n```\n\n## CLI Commands (preferred interface)\n\nUse CLI commands with `--format json` for structured output.\n\n### Debugging & Testing\n\n| Command | Use for |\n| --------------------------------------------- | ---------------------------------------------------------------------------------------- |\n| `adk check --format json` | Offline project validation \u2014 catch config and schema errors |\n| `adk chat --single \"<message>\" --format json` | Test messages to the running bot (use --conversation-id <id> to continue a conversation) |\n| `adk logs [error\\|warning] --format json` | Query dev server logs, build output, and errors |\n| `adk traces [filters...] --format json` | Query trace spans for debugging conversations/workflows |\n| `adk status --format json` | Get project info: name, primitives, and integrations |\n\n### Dependencies (Integrations & Plugins)\n\nManage dependencies through the `adk integrations` / `adk plugins` CLI commands or the Integrations view in the dev console \u2014 never by editing lock files directly. The lock files (`dependencies.dev.lock.json` / `dependencies.prod.lock.json`) are a best-effort mirror of cloud state, kept in sync automatically by the CLI; edit them only as a last resort.\n\n**Integrations** (external services: Slack, webchat, etc.)\n\n| Command | Use for |\n| ------------------------------------ | -------------------------------------------------------- |\n| `adk integrations add <name>` | Add an integration (updates lock file) |\n| `adk integrations remove <name>` | Remove an integration |\n| `adk integrations list` | List installed integrations |\n| `adk integrations search <query>` | Search available integrations on the Botpress Hub |\n| `adk integrations info <name>` | Get detailed info about an integration |\n| `adk integrations pull-lock [--env]` | Pull current cloud state into the lock file |\n| `adk integrations push-lock [--env]` | Push the lock file to cloud (apply lock to bot) |\n| `adk integrations diff [--env]` | Show differences between lock and cloud |\n| `adk integrations copy --from --to` | Copy integration state between dev and prod environments |\n\n**Plugins** (reusable bot capabilities)\n\n| Command | Use for |\n| ------------------------------- | ------------------------------------------- |\n| `adk plugins add <name>` | Add a plugin (updates lock file) |\n| `adk plugins remove <name>` | Remove a plugin |\n| `adk plugins list` | List installed plugins |\n| `adk plugins search <query>` | Search available plugins |\n| `adk plugins info <name>` | Get detailed info about a plugin |\n| `adk plugins pull-lock [--env]` | Pull current cloud state into the lock file |\n| `adk plugins push-lock [--env]` | Push the lock file to cloud |\n| `adk plugins diff [--env]` | Show differences between lock and cloud |\n| `adk plugins copy --from --to` | Copy plugin state between dev and prod |\n\n> **Note:** `adk add`, `adk remove`, `adk list`, `adk search`, `adk info` are deprecated aliases \u2014 use `adk integrations <command>` or `adk plugins <command>` instead.\n\n### Workflows\n\n| Command | Use for |\n| ---------------------------------------------------- | -------------------------------------------------- |\n| `adk workflows list --format json` | Discover available workflows |\n| `adk workflows inspect <name> --format json` | Get workflow input schema |\n| `adk workflows run <name> '<payload>' --format json` | Execute a workflow |\n| `adk workflows runs [filters] --format json` | List workflow runs |\n| `adk workflows runs <wrkflow_id> --format json` | Inspect a single run (status + state + step cache) |\n\n> **Tip:** The dev server must be running (`adk dev`) for testing and trace tools to work.\n\n### Skills\n\n`adk init` creates the Agent(0) project capability bundle at `.agent0/capabilities` and installs public ADK skills/commands for external coding harnesses. If the Agent(0) bundle is missing or stale after an ADK upgrade, run `adk agent0 upgrade`.\n\n## Project Overview\n\n<!-- Describe what your agent does -->\n\n## Architecture & Conventions\n\n<!-- Add project-specific patterns, decisions, and conventions -->\n\n## Notes\n\n<!-- Add anything else relevant to your project -->\n", TEXT_EXTENSIONS, DEPLOYED_AGENT_MANIFEST_SCHEMA_VERSION = 1, DEPLOYED_AGENT_MANIFEST_FILE_KEY = ".adk/deployed-agent-manifest.json", ADK_MANIFEST_BOT_TAGS, DEPLOYED_AGENT_MANIFEST_TAGS, deployedAgentManifestPrimitiveSchema, deployedAgentManifestSchema, transforms, getIntegrationHash = (integration) => {
909255
909255
  return crypto26.createHash("sha256").update(`${integration.alias}|${integration.definition?.id}|${integration.definition?.version}|${integration.definition?.updatedAt}`).digest("hex");
909256
909256
  }, getPascalAlias = (integration) => pascalCase(getIntegrationAlias(integration.alias)), getIntegrationNames = (integration) => ({
909257
909257
  typings: {
@@ -921693,7 +921693,7 @@ caused by: ` + e7.fullStack(i7);
921693
921693
  require_package3 = __commonJS9((exports7, module) => {
921694
921694
  module.exports = {
921695
921695
  name: "@botpress/adk",
921696
- version: "1.19.0-beta.4",
921696
+ version: "1.19.0-beta.5",
921697
921697
  description: "Core ADK library for building AI agents on Botpress",
921698
921698
  keywords: [
921699
921699
  "adk",
@@ -921750,7 +921750,7 @@ caused by: ` + e7.fullStack(i7);
921750
921750
  "@botpress/cli": "~6.8.1",
921751
921751
  "@botpress/client": "~1.46.0",
921752
921752
  "@botpress/cognitive": "~0.5.4",
921753
- "@botpress/runtime": "^1.19.0-beta.4",
921753
+ "@botpress/runtime": "^1.19.0-beta.5",
921754
921754
  "@botpress/sdk": "~6.11.1",
921755
921755
  "@bpinternal/jex": "^1.2.4",
921756
921756
  "@bpinternal/yargs-extra": "^0.0.21",
@@ -935092,19 +935092,19 @@ var init_embedded_assets_generated = __esm(() => {
935092
935092
 
935093
935093
  // src/utils/embedded-assets.ts
935094
935094
  function getEmbeddedAssets() {
935095
- return _assets;
935095
+ return _assets ?? [];
935096
935096
  }
935097
935097
  function getEmbeddedAsset(path50) {
935098
- return _assets.find((asset) => asset.path === path50);
935098
+ return getEmbeddedAssets().find((asset) => asset.path === path50);
935099
935099
  }
935100
935100
  function hasEmbeddedAssets() {
935101
- return _assets.length > 0;
935101
+ return getEmbeddedAssets().length > 0;
935102
935102
  }
935103
935103
  var _assets;
935104
935104
  var init_embedded_assets = __esm(async () => {
935105
935105
  try {
935106
935106
  const mod = await Promise.resolve().then(() => (init_embedded_assets_generated(), exports_embedded_assets_generated));
935107
- _assets = mod.embeddedAssets;
935107
+ _assets = Array.isArray(mod.embeddedAssets) ? mod.embeddedAssets : [];
935108
935108
  } catch (e7) {
935109
935109
  if (e7?.code !== "MODULE_NOT_FOUND" && e7?.name !== "ResolveError" && e7?.name !== "ResolveMessage")
935110
935110
  throw e7;
@@ -937002,12 +937002,283 @@ var init_project_supervisor = __esm(() => {
937002
937002
  ADK_DIR2 = join20(homedir7(), ".adk");
937003
937003
  });
937004
937004
 
937005
+ // src/utils/agent0-capabilities.ts
937006
+ import {
937007
+ copyFileSync as copyFileSync2,
937008
+ existsSync as existsSync16,
937009
+ mkdirSync as mkdirSync4,
937010
+ readdirSync as readdirSync7,
937011
+ readFileSync as readFileSync17,
937012
+ rmSync,
937013
+ statSync as statSync4,
937014
+ writeFileSync as writeFileSync8
937015
+ } from "fs";
937016
+ import { basename as basename4, dirname as dirname9, extname as extname3, join as join21, normalize as normalize9, sep as sep9 } from "path";
937017
+ import { fileURLToPath as fileURLToPath13 } from "url";
937018
+ function getCurrentAgent0CapabilityBundleVersion() {
937019
+ return CLI_VERSION;
937020
+ }
937021
+ function getAgent0ProjectCapabilitiesRoot(projectPath) {
937022
+ return join21(projectPath, AGENT0_PROJECT_DIR, AGENT0_PROJECT_CAPABILITIES_DIR);
937023
+ }
937024
+ function getAgent0ProjectCapabilitiesManifestPath(projectPath) {
937025
+ return join21(getAgent0ProjectCapabilitiesRoot(projectPath), AGENT0_PROJECT_CAPABILITIES_MANIFEST);
937026
+ }
937027
+ function readAgent0CapabilitiesManifest(projectPath) {
937028
+ const manifestPath = getAgent0ProjectCapabilitiesManifestPath(projectPath);
937029
+ if (!existsSync16(manifestPath))
937030
+ return;
937031
+ try {
937032
+ const value2 = JSON.parse(readFileSync17(manifestPath, "utf8"));
937033
+ if (value2.schemaVersion !== 1 || typeof value2.capabilityBundleVersion !== "string")
937034
+ return;
937035
+ return {
937036
+ schemaVersion: 1,
937037
+ adkVersion: typeof value2.adkVersion === "string" ? value2.adkVersion : value2.capabilityBundleVersion,
937038
+ capabilityBundleVersion: value2.capabilityBundleVersion,
937039
+ generatedAt: typeof value2.generatedAt === "string" ? value2.generatedAt : "",
937040
+ capabilitiesRoot: typeof value2.capabilitiesRoot === "string" ? value2.capabilitiesRoot : "",
937041
+ skills: Array.isArray(value2.skills) ? value2.skills.filter((item) => typeof item === "string") : [],
937042
+ playbooks: Array.isArray(value2.playbooks) ? value2.playbooks.filter((item) => typeof item === "string") : []
937043
+ };
937044
+ } catch {
937045
+ return;
937046
+ }
937047
+ }
937048
+ function checkAgent0CapabilitiesStatus(projectPath) {
937049
+ const currentVersion = getCurrentAgent0CapabilityBundleVersion();
937050
+ const manifestPath = getAgent0ProjectCapabilitiesManifestPath(projectPath);
937051
+ const manifest = readAgent0CapabilitiesManifest(projectPath);
937052
+ if (!manifest) {
937053
+ return { state: "missing", currentVersion, manifestPath };
937054
+ }
937055
+ if (manifest.capabilityBundleVersion !== currentVersion) {
937056
+ return {
937057
+ state: "stale",
937058
+ currentVersion,
937059
+ installedVersion: manifest.capabilityBundleVersion,
937060
+ manifestPath
937061
+ };
937062
+ }
937063
+ if (!manifestHasRequiredCapabilityFiles(projectPath, manifest)) {
937064
+ return {
937065
+ state: "stale",
937066
+ currentVersion,
937067
+ installedVersion: manifest.capabilityBundleVersion,
937068
+ manifestPath
937069
+ };
937070
+ }
937071
+ return {
937072
+ state: "current",
937073
+ currentVersion,
937074
+ installedVersion: manifest.capabilityBundleVersion,
937075
+ manifestPath
937076
+ };
937077
+ }
937078
+ function manifestHasRequiredCapabilityFiles(projectPath, manifest) {
937079
+ if (manifest.skills.length === 0 || manifest.playbooks.length === 0)
937080
+ return false;
937081
+ const capabilitiesRoot = getAgent0ProjectCapabilitiesRoot(projectPath);
937082
+ return manifest.skills.every((skill) => isFile7(join21(capabilitiesRoot, AGENT0_PROJECT_SKILLS_DIR, skill, "SKILL.md"))) && manifest.playbooks.every((playbook) => isFile7(join21(capabilitiesRoot, AGENT0_PROJECT_PLAYBOOKS_DIR, playbook)));
937083
+ }
937084
+ function isFile7(path51) {
937085
+ return existsSync16(path51) && statSync4(path51).isFile();
937086
+ }
937087
+ async function installAgent0Capabilities(projectPath) {
937088
+ const capabilitiesRoot = getAgent0ProjectCapabilitiesRoot(projectPath);
937089
+ const manifestPath = getAgent0ProjectCapabilitiesManifestPath(projectPath);
937090
+ const previousManifest = readAgent0CapabilitiesManifest(projectPath);
937091
+ const status = checkAgent0CapabilitiesStatus(projectPath);
937092
+ const source = resolveCapabilitySource();
937093
+ mkdirSync4(capabilitiesRoot, { recursive: true });
937094
+ cleanupManagedCapabilities(projectPath, previousManifest, source);
937095
+ await copyCapabilitiesToProject(capabilitiesRoot, source);
937096
+ const manifest = {
937097
+ schemaVersion: 1,
937098
+ adkVersion: getCurrentAgent0CapabilityBundleVersion(),
937099
+ capabilityBundleVersion: getCurrentAgent0CapabilityBundleVersion(),
937100
+ generatedAt: new Date().toISOString(),
937101
+ capabilitiesRoot: join21(AGENT0_PROJECT_DIR, AGENT0_PROJECT_CAPABILITIES_DIR),
937102
+ skills: source.skills,
937103
+ playbooks: source.playbooks
937104
+ };
937105
+ writeFileSync8(manifestPath, JSON.stringify(manifest, null, 2) + `
937106
+ `);
937107
+ return {
937108
+ success: true,
937109
+ projectPath,
937110
+ capabilitiesRoot,
937111
+ manifestPath,
937112
+ source: source.kind,
937113
+ currentVersion: getCurrentAgent0CapabilityBundleVersion(),
937114
+ previousVersion: status.state === "missing" ? undefined : status.installedVersion ?? previousManifest?.capabilityBundleVersion,
937115
+ wasCurrent: status.state === "current",
937116
+ skills: {
937117
+ installed: source.skills.length,
937118
+ names: source.skills
937119
+ },
937120
+ playbooks: {
937121
+ installed: source.playbooks.length,
937122
+ files: source.playbooks
937123
+ }
937124
+ };
937125
+ }
937126
+ function resolveCapabilitySource() {
937127
+ const embedded = resolveEmbeddedCapabilitySource();
937128
+ if (embedded)
937129
+ return embedded;
937130
+ const skillsRoot = resolveBundledSkillsRoot();
937131
+ const playbooksRoot = resolveBundledPlaybooksRoot();
937132
+ if (!skillsRoot || !playbooksRoot) {
937133
+ throw new Error("Agent(0) capability bundle is missing from this ADK installation.");
937134
+ }
937135
+ return {
937136
+ kind: "filesystem",
937137
+ skillsRoot,
937138
+ playbooksRoot,
937139
+ skills: listSkillNames(skillsRoot),
937140
+ playbooks: listMarkdownFiles(playbooksRoot)
937141
+ };
937142
+ }
937143
+ function resolveBundledSkillsRoot() {
937144
+ const baseDir = moduleDir();
937145
+ return firstExistingDirectory([
937146
+ join21(baseDir, "agent0-assets", "skills"),
937147
+ join21(baseDir, "..", "agent0-assets", "skills"),
937148
+ join21(baseDir, "..", "..", "agent0-assets", "skills"),
937149
+ join21(baseDir, "..", "..", "..", "adk", "src", "agent0", "capabilities", "skills"),
937150
+ join21(baseDir, "..", "..", "..", "adk", "dist", "agent0", "capabilities", "skills")
937151
+ ]);
937152
+ }
937153
+ function resolveBundledPlaybooksRoot() {
937154
+ const baseDir = moduleDir();
937155
+ return firstExistingDirectory([
937156
+ join21(baseDir, "agent0-assets", "playbooks"),
937157
+ join21(baseDir, "..", "agent0-assets", "playbooks"),
937158
+ join21(baseDir, "..", "..", "agent0-assets", "playbooks"),
937159
+ join21(baseDir, "..", "..", "..", "adk", "src", "agent0", "capabilities", "commands"),
937160
+ join21(baseDir, "..", "..", "..", "adk", "dist", "agent0", "capabilities", "commands")
937161
+ ]);
937162
+ }
937163
+ function resolveEmbeddedCapabilitySource() {
937164
+ const files = [];
937165
+ const skills = new Set;
937166
+ const playbooks = new Set;
937167
+ for (const asset of getAvailableEmbeddedAssets()) {
937168
+ const normalizedPath = asset.path.replace(/\\/g, "/");
937169
+ const skillRelative = stripPrefix(normalizedPath, EMBEDDED_SKILLS_PREFIX);
937170
+ if (skillRelative) {
937171
+ const skillName = firstPathSegment(skillRelative);
937172
+ if (!skillName)
937173
+ continue;
937174
+ skills.add(skillName);
937175
+ files.push({ asset, relativePath: join21(AGENT0_PROJECT_SKILLS_DIR, skillRelative) });
937176
+ continue;
937177
+ }
937178
+ const playbookRelative = stripPrefix(normalizedPath, EMBEDDED_PLAYBOOKS_PREFIX) ?? stripPrefix(normalizedPath, EMBEDDED_COMMANDS_PREFIX);
937179
+ if (playbookRelative && extname3(playbookRelative) === ".md") {
937180
+ playbooks.add(basename4(playbookRelative));
937181
+ files.push({ asset, relativePath: join21(AGENT0_PROJECT_PLAYBOOKS_DIR, playbookRelative) });
937182
+ }
937183
+ }
937184
+ if (skills.size === 0 || playbooks.size === 0)
937185
+ return;
937186
+ return {
937187
+ kind: "embedded",
937188
+ files,
937189
+ skills: [...skills].toSorted(),
937190
+ playbooks: [...playbooks].toSorted()
937191
+ };
937192
+ }
937193
+ function getAvailableEmbeddedAssets() {
937194
+ const getEmbeddedAssets2 = getEmbeddedAssets;
937195
+ if (typeof getEmbeddedAssets2 !== "function")
937196
+ return [];
937197
+ const assets2 = getEmbeddedAssets2();
937198
+ return Array.isArray(assets2) ? assets2 : [];
937199
+ }
937200
+ async function copyCapabilitiesToProject(capabilitiesRoot, source) {
937201
+ if (source.kind === "embedded") {
937202
+ for (const file of source.files) {
937203
+ const destination = safeJoin(capabilitiesRoot, file.relativePath);
937204
+ mkdirSync4(dirname9(destination), { recursive: true });
937205
+ const bytes3 = Buffer.from(await Bun.file(file.asset.file).arrayBuffer());
937206
+ writeFileSync8(destination, bytes3);
937207
+ }
937208
+ return;
937209
+ }
937210
+ const skillsRoot = join21(capabilitiesRoot, AGENT0_PROJECT_SKILLS_DIR);
937211
+ const playbooksRoot = join21(capabilitiesRoot, AGENT0_PROJECT_PLAYBOOKS_DIR);
937212
+ mkdirSync4(playbooksRoot, { recursive: true });
937213
+ for (const skill of source.skills) {
937214
+ copyTree(join21(source.skillsRoot, skill), join21(skillsRoot, skill));
937215
+ }
937216
+ for (const playbook of source.playbooks) {
937217
+ copyFileSync2(join21(source.playbooksRoot, playbook), join21(playbooksRoot, playbook));
937218
+ }
937219
+ }
937220
+ function cleanupManagedCapabilities(projectPath, _previousManifest, _source) {
937221
+ const capabilitiesRoot = getAgent0ProjectCapabilitiesRoot(projectPath);
937222
+ const skillsRoot = join21(capabilitiesRoot, AGENT0_PROJECT_SKILLS_DIR);
937223
+ const playbooksRoot = join21(capabilitiesRoot, AGENT0_PROJECT_PLAYBOOKS_DIR);
937224
+ rmSync(skillsRoot, { recursive: true, force: true });
937225
+ rmSync(playbooksRoot, { recursive: true, force: true });
937226
+ }
937227
+ function copyTree(source, destination) {
937228
+ const stats = statSync4(source);
937229
+ if (stats.isDirectory()) {
937230
+ mkdirSync4(destination, { recursive: true });
937231
+ for (const entry of readdirSync7(source)) {
937232
+ copyTree(join21(source, entry), join21(destination, entry));
937233
+ }
937234
+ return;
937235
+ }
937236
+ mkdirSync4(dirname9(destination), { recursive: true });
937237
+ copyFileSync2(source, destination);
937238
+ }
937239
+ function listSkillNames(skillsRoot) {
937240
+ return readdirSync7(skillsRoot).toSorted().filter((entry) => {
937241
+ const skillDir = join21(skillsRoot, entry);
937242
+ return statSync4(skillDir).isDirectory() && existsSync16(join21(skillDir, "SKILL.md"));
937243
+ });
937244
+ }
937245
+ function listMarkdownFiles(root4) {
937246
+ return readdirSync7(root4).toSorted().filter((entry) => extname3(entry) === ".md" && statSync4(join21(root4, entry)).isFile());
937247
+ }
937248
+ function firstExistingDirectory(paths) {
937249
+ return paths.find((path51) => existsSync16(path51) && statSync4(path51).isDirectory());
937250
+ }
937251
+ function stripPrefix(value2, prefix) {
937252
+ return value2.startsWith(prefix) ? value2.slice(prefix.length) : undefined;
937253
+ }
937254
+ function firstPathSegment(value2) {
937255
+ return value2.split("/").find(Boolean);
937256
+ }
937257
+ function safeJoin(root4, relativePath) {
937258
+ const destination = normalize9(join21(root4, relativePath));
937259
+ const normalizedRoot = normalize9(root4);
937260
+ if (destination !== normalizedRoot && !destination.startsWith(normalizedRoot + sep9)) {
937261
+ throw new Error(`Refusing to write Agent(0) capability outside ${root4}: ${relativePath}`);
937262
+ }
937263
+ return destination;
937264
+ }
937265
+ function moduleDir() {
937266
+ return dirname9(fileURLToPath13(import.meta.url));
937267
+ }
937268
+ var AGENT0_PROJECT_DIR = ".agent0", AGENT0_PROJECT_CAPABILITIES_DIR = "capabilities", AGENT0_PROJECT_SKILLS_DIR = "skills", AGENT0_PROJECT_PLAYBOOKS_DIR = "playbooks", AGENT0_PROJECT_CAPABILITIES_MANIFEST = "manifest.json", EMBEDDED_CAPABILITIES_PREFIX = "/agent0-capabilities", EMBEDDED_SKILLS_PREFIX, EMBEDDED_PLAYBOOKS_PREFIX, EMBEDDED_COMMANDS_PREFIX;
937269
+ var init_agent0_capabilities = __esm(async () => {
937270
+ await init_embedded_assets();
937271
+ EMBEDDED_SKILLS_PREFIX = `${EMBEDDED_CAPABILITIES_PREFIX}/skills/`;
937272
+ EMBEDDED_PLAYBOOKS_PREFIX = `${EMBEDDED_CAPABILITIES_PREFIX}/playbooks/`;
937273
+ EMBEDDED_COMMANDS_PREFIX = `${EMBEDDED_CAPABILITIES_PREFIX}/commands/`;
937274
+ });
937275
+
937005
937276
  // package.json
937006
937277
  var package_default;
937007
937278
  var init_package = __esm(() => {
937008
937279
  package_default = {
937009
937280
  name: "@botpress/adk-cli",
937010
- version: "1.19.0-beta.4",
937281
+ version: "1.19.0-beta.5",
937011
937282
  description: "Command-line interface for the Botpress Agent Development Kit (ADK)",
937012
937283
  keywords: [
937013
937284
  "adk",
@@ -937049,12 +937320,12 @@ var init_package = __esm(() => {
937049
937320
  "check:type": "bun scripts/generate-build-constants.ts >/dev/null && bun scripts/embed-assets.ts >/dev/null && tsc --noEmit"
937050
937321
  },
937051
937322
  dependencies: {
937052
- "@botpress/adk": "^1.19.0-beta.4",
937323
+ "@botpress/adk": "^1.19.0-beta.5",
937053
937324
  "@botpress/chat": "~0.5.5",
937054
937325
  "@botpress/cli": "~6.8.1",
937055
937326
  "@botpress/client": "~1.46.0",
937056
- "@botpress/evals": "^1.19.0-beta.4",
937057
- "@botpress/runtime": "^1.19.0-beta.4",
937327
+ "@botpress/evals": "^1.19.0-beta.5",
937328
+ "@botpress/runtime": "^1.19.0-beta.5",
937058
937329
  "@botpress/sdk": "~6.11.1",
937059
937330
  "@botpress/webchat-client": "^0.7.2",
937060
937331
  "@modelcontextprotocol/sdk": "^1.25.1",
@@ -937092,15 +937363,15 @@ var exports_adk_version = {};
937092
937363
  __export(exports_adk_version, {
937093
937364
  getAdkVersion: () => getAdkVersion2
937094
937365
  });
937095
- import { readFileSync as readFileSync17 } from "fs";
937096
- import { join as join21 } from "path";
937366
+ import { readFileSync as readFileSync18 } from "fs";
937367
+ import { join as join22 } from "path";
937097
937368
  function getAdkVersion2() {
937098
937369
  if (_cachedVersion !== undefined) {
937099
937370
  return _cachedVersion;
937100
937371
  }
937101
937372
  try {
937102
- const adkPackagePath = join21(process.cwd(), "node_modules/@botpress/adk/package.json");
937103
- const pkg = JSON.parse(readFileSync17(adkPackagePath, "utf-8"));
937373
+ const adkPackagePath = join22(process.cwd(), "node_modules/@botpress/adk/package.json");
937374
+ const pkg = JSON.parse(readFileSync18(adkPackagePath, "utf-8"));
937104
937375
  _cachedVersion = pkg.version;
937105
937376
  } catch {
937106
937377
  _cachedVersion = package_default.version;
@@ -937131,17 +937402,184 @@ var init_skills_ref = __esm(() => {
937131
937402
  init_adk_version();
937132
937403
  });
937133
937404
 
937405
+ // src/utils/fetch-commands.ts
937406
+ import { existsSync as existsSync17, mkdirSync as mkdirSync5, writeFileSync as writeFileSync9 } from "fs";
937407
+ import { basename as basename5, join as join23 } from "path";
937408
+ function getGithubRawBase() {
937409
+ return `https://raw.githubusercontent.com/${REPO}/${getSkillsGitRef()}/${COMMANDS_DIR}`;
937410
+ }
937411
+ function isManifest(value2) {
937412
+ return ManifestSchema.safeParse(value2).success;
937413
+ }
937414
+ async function fetchWithTimeout(url6, timeoutMs) {
937415
+ const controller = new AbortController;
937416
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
937417
+ try {
937418
+ return await fetch(url6, { signal: controller.signal });
937419
+ } finally {
937420
+ clearTimeout(timer);
937421
+ }
937422
+ }
937423
+ async function fetchManifest() {
937424
+ try {
937425
+ const res = await fetchWithTimeout(`${getGithubRawBase()}/manifest.json`, REQUEST_TIMEOUT_MS);
937426
+ if (!res.ok) {
937427
+ return null;
937428
+ }
937429
+ const data = await res.json();
937430
+ if (!isManifest(data)) {
937431
+ return null;
937432
+ }
937433
+ return data;
937434
+ } catch {
937435
+ return null;
937436
+ }
937437
+ }
937438
+ function listCommandFiles(manifest) {
937439
+ if (manifest && manifest.commands.length > 0) {
937440
+ return manifest.commands.map((entry) => entry.path);
937441
+ }
937442
+ return [];
937443
+ }
937444
+ async function downloadCommand(filePath) {
937445
+ try {
937446
+ const res = await fetchWithTimeout(`${getGithubRawBase()}/${filePath}`, REQUEST_TIMEOUT_MS);
937447
+ if (!res.ok) {
937448
+ return null;
937449
+ }
937450
+ return await res.text();
937451
+ } catch {
937452
+ return null;
937453
+ }
937454
+ }
937455
+ async function installCommands(projectPath, targets) {
937456
+ const result2 = { attempted: true, success: true, installedCommands: 0, failed: 0 };
937457
+ const targetPaths = targets.map((t9) => join23(projectPath, TARGET_DIRS[t9]));
937458
+ for (const dir of targetPaths) {
937459
+ if (!existsSync17(dir)) {
937460
+ mkdirSync5(dir, { recursive: true });
937461
+ }
937462
+ }
937463
+ const manifest = await fetchManifest();
937464
+ const filenames = listCommandFiles(manifest);
937465
+ const downloads = await Promise.all(filenames.map(async (filePath) => {
937466
+ const content = await downloadCommand(filePath);
937467
+ return { filePath, content };
937468
+ }));
937469
+ for (const { filePath, content } of downloads) {
937470
+ if (content === null) {
937471
+ result2.failed += 1;
937472
+ continue;
937473
+ }
937474
+ const outputName = basename5(filePath);
937475
+ for (const dir of targetPaths) {
937476
+ writeFileSync9(join23(dir, outputName), content);
937477
+ }
937478
+ result2.installedCommands += 1;
937479
+ }
937480
+ if (result2.installedCommands === 0) {
937481
+ result2.success = false;
937482
+ result2.error = "Could not download any command files from GitHub";
937483
+ }
937484
+ return result2;
937485
+ }
937486
+ var REPO = "botpress/skills", COMMANDS_DIR = "commands", REQUEST_TIMEOUT_MS = 15000, TARGET_DIRS, ALL_TARGETS, ManifestEntrySchema, ManifestSchema;
937487
+ var init_fetch_commands = __esm(() => {
937488
+ init_dist5();
937489
+ init_skills_ref();
937490
+ TARGET_DIRS = {
937491
+ "claude-code": ".claude/commands",
937492
+ opencode: ".opencode/commands",
937493
+ cursor: ".cursor/commands"
937494
+ };
937495
+ ALL_TARGETS = Object.keys(TARGET_DIRS);
937496
+ ManifestEntrySchema = ne.object({
937497
+ name: ne.string(),
937498
+ path: ne.string(),
937499
+ description: ne.string()
937500
+ });
937501
+ ManifestSchema = ne.object({
937502
+ commands: ne.array(ManifestEntrySchema)
937503
+ });
937504
+ });
937505
+
937506
+ // src/utils/external-harness-capabilities.ts
937507
+ import { exec as exec3 } from "child_process";
937508
+ import { promisify as promisify4 } from "util";
937509
+ async function installExternalHarnessCapabilities(options) {
937510
+ const commandTargets = options.commandTargets ?? ALL_TARGETS;
937511
+ const skillsCommand = buildExternalHarnessSkillsCommand(options.projectPath, options.packageManagerCommand);
937512
+ const skills = {
937513
+ attempted: true,
937514
+ success: true,
937515
+ command: skillsCommand
937516
+ };
937517
+ try {
937518
+ if (options.runCommand) {
937519
+ await options.runCommand(skillsCommand, options.projectPath);
937520
+ } else {
937521
+ await execAsync(skillsCommand, {
937522
+ cwd: options.projectPath,
937523
+ env: { ...process.env },
937524
+ timeout: 120000
937525
+ });
937526
+ }
937527
+ } catch (error) {
937528
+ skills.success = false;
937529
+ const stderr3 = error instanceof Error && "stderr" in error && error.stderr ? String(error.stderr).trim() : undefined;
937530
+ skills.error = stderr3 || (error instanceof Error ? error.message : String(error));
937531
+ }
937532
+ let commands = { attempted: false, success: true, installedCommands: 0, failed: 0 };
937533
+ if (commandTargets.length > 0) {
937534
+ try {
937535
+ commands = await installCommands(options.projectPath, commandTargets);
937536
+ } catch (error) {
937537
+ commands = {
937538
+ attempted: true,
937539
+ success: false,
937540
+ installedCommands: 0,
937541
+ failed: 0,
937542
+ error: error instanceof Error ? error.message : String(error)
937543
+ };
937544
+ }
937545
+ }
937546
+ return {
937547
+ success: skills.success && commands.success,
937548
+ skills,
937549
+ commands
937550
+ };
937551
+ }
937552
+ function buildExternalHarnessSkillsCommand(projectPath, packageManagerCommand) {
937553
+ const skillsRunner = getSkillsRunner(projectPath, packageManagerCommand);
937554
+ return `${skillsRunner} skills add ${getSkillsRepoRef()} -s '*' -a codex claude-code -y`;
937555
+ }
937556
+ function getSkillsRunner(projectPath, packageManagerCommand) {
937557
+ if (packageManagerCommand) {
937558
+ return packageManagerCommand === "bun" ? "bunx" : "npx";
937559
+ }
937560
+ const managers = detectPackageManagers();
937561
+ const preferred = getPreferredPackageManager(projectPath, managers);
937562
+ return preferred?.command === "bun" ? "bunx" : "npx";
937563
+ }
937564
+ var execAsync;
937565
+ var init_external_harness_capabilities = __esm(() => {
937566
+ init_fetch_commands();
937567
+ init_package_manager();
937568
+ init_skills_ref();
937569
+ execAsync = promisify4(exec3);
937570
+ });
937571
+
937134
937572
  // src/server/project-creator.ts
937135
937573
  import { spawn as spawn5 } from "child_process";
937136
- import { existsSync as existsSync16 } from "fs";
937574
+ import { existsSync as existsSync18 } from "fs";
937137
937575
  import { mkdir as mkdir5, readdir as readdir6, rm as rm5, stat as stat4 } from "fs/promises";
937138
937576
  import { homedir as homedir8 } from "os";
937139
- import { join as join22, resolve as resolve11 } from "path";
937577
+ import { join as join24, resolve as resolve11 } from "path";
937140
937578
  function expandHome2(rawPath) {
937141
937579
  if (rawPath === "~")
937142
937580
  return homedir8();
937143
937581
  if (rawPath.startsWith("~/"))
937144
- return join22(homedir8(), rawPath.slice(2));
937582
+ return join24(homedir8(), rawPath.slice(2));
937145
937583
  return rawPath;
937146
937584
  }
937147
937585
  function jsonErrorMessage2(error) {
@@ -937249,14 +937687,14 @@ class ProjectCreator {
937249
937687
  if (!parentStat || !parentStat.isDirectory()) {
937250
937688
  return errorResponse("Invalid parent", `Parent directory does not exist: ${parentPath}`, 400);
937251
937689
  }
937252
- const projectPath = join22(parentPath, name2);
937690
+ const projectPath = join24(parentPath, name2);
937253
937691
  const previousCreation = this.creations.get(projectPath);
937254
937692
  if (previousCreation?.status === "creating") {
937255
937693
  return successResponse({ status: "creating", projectPath });
937256
937694
  }
937257
937695
  const force = body.force === true;
937258
937696
  let skipScaffolding = false;
937259
- if (existsSync16(projectPath)) {
937697
+ if (existsSync18(projectPath)) {
937260
937698
  const existing = await readdir6(projectPath).catch(() => []);
937261
937699
  if (existing.length > 0) {
937262
937700
  if (force) {
@@ -937308,9 +937746,19 @@ class ProjectCreator {
937308
937746
  }
937309
937747
  state.stage = "dependencies";
937310
937748
  try {
937311
- const skillsCmd = `${packageManager.command === "bun" ? "bunx" : "npx"} skills add ${getSkillsRepoRef()} -s '*' -a codex claude-code -y`;
937312
- await (this.options.runCommand ?? defaultRunCommand)(skillsCmd, state.projectPath);
937313
- } catch {}
937749
+ await installAgent0Capabilities(state.projectPath);
937750
+ } catch (error) {
937751
+ state.warnings.push(`Failed to create Agent(0) capabilities: ${jsonErrorMessage2(error)}`);
937752
+ }
937753
+ const externalHarness = await installExternalHarnessCapabilities({
937754
+ projectPath: state.projectPath,
937755
+ packageManagerCommand: packageManager.command,
937756
+ commandTargets: [],
937757
+ runCommand: this.options.runCommand ?? defaultRunCommand
937758
+ });
937759
+ if (!externalHarness.skills.success) {
937760
+ state.warnings.push(`Failed to install ADK skills: ${externalHarness.skills.error ?? "Unknown error"}`);
937761
+ }
937314
937762
  const declared = generator.getDependencies();
937315
937763
  state.declaredDependencies = declared;
937316
937764
  state.stage = "done";
@@ -937586,12 +938034,13 @@ function notAuthenticated() {
937586
938034
  }), { status: 401, headers: { "Content-Type": "application/json" } });
937587
938035
  }
937588
938036
  var VALID_NAME, TERMINAL_STATE_TTL_MS, COMMAND_OUTPUT_LIMIT, ADK_RUNTIME_BOT_TAGS;
937589
- var init_project_creator = __esm(() => {
938037
+ var init_project_creator = __esm(async () => {
937590
938038
  init_dist16();
937591
938039
  init_dist4();
938040
+ init_external_harness_capabilities();
937592
938041
  init_package_manager();
937593
- init_skills_ref();
937594
938042
  init_responses();
938043
+ await init_agent0_capabilities();
937595
938044
  VALID_NAME = /^[a-zA-Z0-9_-]+$/;
937596
938045
  TERMINAL_STATE_TTL_MS = 5 * 60000;
937597
938046
  COMMAND_OUTPUT_LIMIT = 64 * 1024;
@@ -937600,8 +938049,8 @@ var init_project_creator = __esm(() => {
937600
938049
 
937601
938050
  // src/utils/ensure-templates.ts
937602
938051
  import { createHash as createHash5 } from "crypto";
937603
- import { existsSync as existsSync17, mkdirSync as mkdirSync4, writeFileSync as writeFileSync8 } from "fs";
937604
- import { join as join23, dirname as dirname9 } from "path";
938052
+ import { existsSync as existsSync19, mkdirSync as mkdirSync6, writeFileSync as writeFileSync10 } from "fs";
938053
+ import { join as join25, dirname as dirname10 } from "path";
937605
938054
  async function extractEmbeddedTemplates() {
937606
938055
  const templateAssets = getEmbeddedAssets().filter((a7) => a7.path.startsWith("/templates/"));
937607
938056
  if (templateAssets.length === 0) {
@@ -937613,18 +938062,18 @@ async function extractEmbeddedTemplates() {
937613
938062
  hasher.update(new Uint8Array(await Bun.file(asset.file).arrayBuffer()));
937614
938063
  }
937615
938064
  const versionHash = hasher.digest("hex").slice(0, 12);
937616
- const tmpDir = join23(process.env.TMPDIR || "/tmp", `adk-templates-${versionHash}`);
937617
- if (existsSync17(join23(tmpDir, "template.config.json"))) {
938065
+ const tmpDir = join25(process.env.TMPDIR || "/tmp", `adk-templates-${versionHash}`);
938066
+ if (existsSync19(join25(tmpDir, "template.config.json"))) {
937618
938067
  return tmpDir;
937619
938068
  }
937620
938069
  for (const asset of templateAssets) {
937621
- const filePath = join23(tmpDir, asset.path.replace(/^\/templates\//, ""));
937622
- const dir = dirname9(filePath);
937623
- if (!existsSync17(dir)) {
937624
- mkdirSync4(dir, { recursive: true });
938070
+ const filePath = join25(tmpDir, asset.path.replace(/^\/templates\//, ""));
938071
+ const dir = dirname10(filePath);
938072
+ if (!existsSync19(dir)) {
938073
+ mkdirSync6(dir, { recursive: true });
937625
938074
  }
937626
938075
  const content = await Bun.file(asset.file).arrayBuffer();
937627
- writeFileSync8(filePath, Buffer.from(content));
938076
+ writeFileSync10(filePath, Buffer.from(content));
937628
938077
  }
937629
938078
  return tmpDir;
937630
938079
  }
@@ -937819,7 +938268,7 @@ var init_prod_agent_metadata = __esm(() => {
937819
938268
 
937820
938269
  // src/server/handlers/agent-map/ast/source-cache.ts
937821
938270
  import ts6 from "typescript";
937822
- import { readFileSync as readFileSync18 } from "fs";
938271
+ import { readFileSync as readFileSync19 } from "fs";
937823
938272
  import { resolve as resolve12 } from "path";
937824
938273
  function getCachedSourceFile(agentRoot, relativePath) {
937825
938274
  const absPath = resolve12(agentRoot, relativePath);
@@ -937828,7 +938277,7 @@ function getCachedSourceFile(agentRoot, relativePath) {
937828
938277
  return cached;
937829
938278
  let source;
937830
938279
  try {
937831
- source = readFileSync18(absPath, "utf-8");
938280
+ source = readFileSync19(absPath, "utf-8");
937832
938281
  } catch {
937833
938282
  cache4.set(absPath, null);
937834
938283
  return null;
@@ -937918,14 +938367,14 @@ var init_locations = __esm(() => {
937918
938367
 
937919
938368
  // src/server/handlers/agent-map/ast/compiled-bot.ts
937920
938369
  import ts8 from "typescript";
937921
- import { readFileSync as readFileSync19 } from "fs";
937922
- import { join as join24 } from "path";
938370
+ import { readFileSync as readFileSync20 } from "fs";
938371
+ import { join as join26 } from "path";
937923
938372
  function parseCompiledBotIntegrations(agentRoot) {
937924
938373
  const result2 = new Map;
937925
- const botDefPath = join24(agentRoot, ".adk", "bot", "bot.definition.ts");
938374
+ const botDefPath = join26(agentRoot, ".adk", "bot", "bot.definition.ts");
937926
938375
  let source;
937927
938376
  try {
937928
- source = readFileSync19(botDefPath, "utf-8");
938377
+ source = readFileSync20(botDefPath, "utf-8");
937929
938378
  } catch {
937930
938379
  return result2;
937931
938380
  }
@@ -940220,8 +940669,8 @@ __export(exports_ui_server_entry, {
940220
940669
  runUiServerEntry: () => runUiServerEntry
940221
940670
  });
940222
940671
  var {serve: serve2 } = globalThis.Bun;
940223
- import { writeFileSync as writeFileSync9, mkdirSync as mkdirSync5, unlinkSync as unlinkSync3, renameSync } from "fs";
940224
- import { join as join25, dirname as dirname10 } from "path";
940672
+ import { writeFileSync as writeFileSync11, mkdirSync as mkdirSync7, unlinkSync as unlinkSync3, renameSync } from "fs";
940673
+ import { join as join27, dirname as dirname11 } from "path";
940225
940674
  function parseArgs(args) {
940226
940675
  let port = 3001;
940227
940676
  let standalone = false;
@@ -940237,10 +940686,10 @@ function parseArgs(args) {
940237
940686
  return { port, standalone };
940238
940687
  }
940239
940688
  function writeConsolePort(port) {
940240
- const dir = dirname10(CONSOLE_PORT_FILE);
940241
- mkdirSync5(dir, { recursive: true });
940242
- const tmpFile = join25(dir, `.console.port.${process.pid}.tmp`);
940243
- writeFileSync9(tmpFile, String(port), { encoding: "utf-8", mode: 384 });
940689
+ const dir = dirname11(CONSOLE_PORT_FILE);
940690
+ mkdirSync7(dir, { recursive: true });
940691
+ const tmpFile = join27(dir, `.console.port.${process.pid}.tmp`);
940692
+ writeFileSync11(tmpFile, String(port), { encoding: "utf-8", mode: 384 });
940244
940693
  renameSync(tmpFile, CONSOLE_PORT_FILE);
940245
940694
  }
940246
940695
  function removeConsolePort() {
@@ -940279,7 +940728,7 @@ function parseAgentScopedProxyPath(pathname) {
940279
940728
  }
940280
940729
  async function runUiServerEntry(args = process.argv.slice(2)) {
940281
940730
  const { port: startPort, standalone } = parseArgs(args);
940282
- mkdirSync5(dirname10(CONSOLE_SOCKET_PATH), { recursive: true });
940731
+ mkdirSync7(dirname11(CONSOLE_SOCKET_PATH), { recursive: true });
940283
940732
  const socketServer = new ConsoleSocketServer({
940284
940733
  socketPath: CONSOLE_SOCKET_PATH,
940285
940734
  standalone,
@@ -940505,13 +940954,13 @@ var init_ui_server_entry = __esm(async () => {
940505
940954
  init_runtime_version_check();
940506
940955
  init_lifecycle();
940507
940956
  init_project_supervisor();
940508
- init_project_creator();
940509
940957
  init_prod_bot_api_handler();
940510
940958
  init_dist16();
940511
940959
  init_feature_flags3();
940512
940960
  init_timing();
940513
940961
  await __promiseAll([
940514
940962
  init_static(),
940963
+ init_project_creator(),
940515
940964
  init_ensure_templates()
940516
940965
  ]);
940517
940966
  if (false) {}
@@ -940936,7 +941385,7 @@ function stripFinalNewline2(input) {
940936
941385
  // ../../node_modules/.bun/npm-run-path@5.3.0/node_modules/npm-run-path/index.js
940937
941386
  import process26 from "process";
940938
941387
  import path55 from "path";
940939
- import { fileURLToPath as fileURLToPath13 } from "url";
941388
+ import { fileURLToPath as fileURLToPath14 } from "url";
940940
941389
  var npmRunPath2 = ({
940941
941390
  cwd: cwd3 = process26.cwd(),
940942
941391
  path: pathOption = process26.env[pathKey()],
@@ -940944,7 +941393,7 @@ var npmRunPath2 = ({
940944
941393
  execPath: execPath3 = process26.execPath,
940945
941394
  addExecPath = true
940946
941395
  } = {}) => {
940947
- const cwdString = cwd3 instanceof URL ? fileURLToPath13(cwd3) : cwd3;
941396
+ const cwdString = cwd3 instanceof URL ? fileURLToPath14(cwd3) : cwd3;
940948
941397
  const cwdPath = path55.resolve(cwdString);
940949
941398
  const result2 = [];
940950
941399
  if (preferLocal) {
@@ -940962,7 +941411,7 @@ var npmRunPath2 = ({
940962
941411
  cwdPath = path55.resolve(cwdPath, "..");
940963
941412
  }
940964
941413
  }, applyExecPath2 = (result2, execPath3, cwdPath) => {
940965
- const execPathString = execPath3 instanceof URL ? fileURLToPath13(execPath3) : execPath3;
941414
+ const execPathString = execPath3 instanceof URL ? fileURLToPath14(execPath3) : execPath3;
940966
941415
  result2.push(path55.resolve(cwdPath, execPathString, ".."));
940967
941416
  }, npmRunPathEnv2 = ({ env: env8 = process26.env, ...options } = {}) => {
940968
941417
  env8 = { ...env8 };
@@ -941842,7 +942291,7 @@ var require_merge_stream = __commonJS((exports8, module) => {
941842
942291
  });
941843
942292
 
941844
942293
  // ../../node_modules/.bun/execa@8.0.1/node_modules/execa/lib/stream.js
941845
- import { createReadStream as createReadStream3, readFileSync as readFileSync20 } from "fs";
942294
+ import { createReadStream as createReadStream3, readFileSync as readFileSync21 } from "fs";
941846
942295
  import { setTimeout as setTimeout6 } from "timers/promises";
941847
942296
  var import_merge_stream, validateInputOptions = (input) => {
941848
942297
  if (input !== undefined) {
@@ -941853,7 +942302,7 @@ var import_merge_stream, validateInputOptions = (input) => {
941853
942302
  return input;
941854
942303
  }
941855
942304
  validateInputOptions(input);
941856
- return readFileSync20(inputFile);
942305
+ return readFileSync21(inputFile);
941857
942306
  }, handleInputSync = (options) => {
941858
942307
  const input = getInputSync(options);
941859
942308
  if (isStream8(input)) {
@@ -942297,7 +942746,7 @@ var init_termux = __esm(() => {
942297
942746
 
942298
942747
  // ../../node_modules/.bun/clipboardy@4.0.0/node_modules/clipboardy/lib/linux.js
942299
942748
  import path57 from "path";
942300
- import { fileURLToPath as fileURLToPath14 } from "url";
942749
+ import { fileURLToPath as fileURLToPath15 } from "url";
942301
942750
  var __dirname2, xsel = "xsel", xselFallback, copyArguments, pasteArguments, makeError3 = (xselError, fallbackError) => {
942302
942751
  let error;
942303
942752
  if (xselError.code === "ENOENT") {
@@ -942333,7 +942782,7 @@ var __dirname2, xsel = "xsel", xselFallback, copyArguments, pasteArguments, make
942333
942782
  }, clipboard2, linux_default;
942334
942783
  var init_linux = __esm(() => {
942335
942784
  init_execa2();
942336
- __dirname2 = path57.dirname(fileURLToPath14(import.meta.url));
942785
+ __dirname2 = path57.dirname(fileURLToPath15(import.meta.url));
942337
942786
  xselFallback = path57.join(__dirname2, "../fallbacks/linux/xsel");
942338
942787
  copyArguments = ["--clipboard", "--input"];
942339
942788
  pasteArguments = ["--clipboard", "--output"];
@@ -942370,7 +942819,7 @@ var init_macos = __esm(() => {
942370
942819
  });
942371
942820
 
942372
942821
  // ../../node_modules/.bun/system-architecture@0.1.0/node_modules/system-architecture/index.js
942373
- import { promisify as promisify4 } from "util";
942822
+ import { promisify as promisify5 } from "util";
942374
942823
  import process30 from "process";
942375
942824
  import childProcess2 from "child_process";
942376
942825
  function systemArchitectureSync() {
@@ -942395,7 +942844,7 @@ function systemArchitectureSync() {
942395
942844
  }
942396
942845
  var execFilePromises;
942397
942846
  var init_system_architecture = __esm(() => {
942398
- execFilePromises = promisify4(childProcess2.execFile);
942847
+ execFilePromises = promisify5(childProcess2.execFile);
942399
942848
  });
942400
942849
 
942401
942850
  // ../../node_modules/.bun/is64bit@2.0.0/node_modules/is64bit/index.js
@@ -942415,12 +942864,12 @@ var init_is64bit = __esm(() => {
942415
942864
 
942416
942865
  // ../../node_modules/.bun/clipboardy@4.0.0/node_modules/clipboardy/lib/windows.js
942417
942866
  import path58 from "path";
942418
- import { fileURLToPath as fileURLToPath15 } from "url";
942867
+ import { fileURLToPath as fileURLToPath16 } from "url";
942419
942868
  var __dirname3, binarySuffix, windowBinaryPath, clipboard4, windows_default;
942420
942869
  var init_windows = __esm(() => {
942421
942870
  init_execa2();
942422
942871
  init_is64bit();
942423
- __dirname3 = path58.dirname(fileURLToPath15(import.meta.url));
942872
+ __dirname3 = path58.dirname(fileURLToPath16(import.meta.url));
942424
942873
  binarySuffix = is64bitSync() ? "x86_64" : "i686";
942425
942874
  windowBinaryPath = path58.join(__dirname3, `../fallbacks/windows/clipboard_${binarySuffix}.exe`);
942426
942875
  clipboard4 = {
@@ -943037,7 +943486,7 @@ var import_react33, jsx_dev_runtime8, UserInput = ({
943037
943486
  const handlePaste = (content) => {
943038
943487
  const lines = content.split(`
943039
943488
  `);
943040
- const isFile7 = isFilePath(content);
943489
+ const isFile8 = isFilePath(content);
943041
943490
  const currentLines = textInput.split(`
943042
943491
  `).length;
943043
943492
  const contentLines = lines.length;
@@ -943047,7 +943496,7 @@ var import_react33, jsx_dev_runtime8, UserInput = ({
943047
943496
  if (currentLines + contentLines - 1 > maxLines) {
943048
943497
  return;
943049
943498
  }
943050
- if (isFile7) {
943499
+ if (isFile8) {
943051
943500
  const pasteId = nextPasteId;
943052
943501
  setPastedContent((prev) => new Map(prev).set(pasteId, { id: pasteId, content, isFile: true }));
943053
943502
  setNextPasteId((prev) => prev + 1);
@@ -943733,7 +944182,7 @@ var init_RadioButtons = __esm(async () => {
943733
944182
  });
943734
944183
 
943735
944184
  // src/components/InitWizard.tsx
943736
- import { existsSync as existsSync18 } from "fs";
944185
+ import { existsSync as existsSync20 } from "fs";
943737
944186
  import { resolve as resolve13 } from "path";
943738
944187
  var import_react35, jsx_dev_runtime10, InitWizard = ({
943739
944188
  templates,
@@ -943840,7 +944289,7 @@ var import_react35, jsx_dev_runtime10, InitWizard = ({
943840
944289
  if (!/^[a-zA-Z0-9_-]+$/.test(value2)) {
943841
944290
  return "Agent name can only contain letters, numbers, hyphens, and underscores";
943842
944291
  }
943843
- if (existsSync18(resolve13(process.cwd(), value2))) {
944292
+ if (existsSync20(resolve13(process.cwd(), value2))) {
943844
944293
  return `"${value2}" already exists \u2014 choose a different agent name`;
943845
944294
  }
943846
944295
  return null;
@@ -943999,7 +944448,7 @@ function defineLazyProperty(object, propertyName2, valueGetter) {
943999
944448
  }
944000
944449
 
944001
944450
  // ../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
944002
- import { promisify as promisify5 } from "util";
944451
+ import { promisify as promisify6 } from "util";
944003
944452
  import process33 from "process";
944004
944453
  import { execFile as execFile2 } from "child_process";
944005
944454
  async function defaultBrowserId() {
@@ -944016,12 +944465,12 @@ async function defaultBrowserId() {
944016
944465
  }
944017
944466
  var execFileAsync;
944018
944467
  var init_default_browser_id = __esm(() => {
944019
- execFileAsync = promisify5(execFile2);
944468
+ execFileAsync = promisify6(execFile2);
944020
944469
  });
944021
944470
 
944022
944471
  // ../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js
944023
944472
  import process34 from "process";
944024
- import { promisify as promisify6 } from "util";
944473
+ import { promisify as promisify7 } from "util";
944025
944474
  import { execFile as execFile3, execFileSync as execFileSync2 } from "child_process";
944026
944475
  async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
944027
944476
  if (process34.platform !== "darwin") {
@@ -944037,7 +944486,7 @@ async function runAppleScript(script, { humanReadableOutput = true, signal } = {
944037
944486
  }
944038
944487
  var execFileAsync2;
944039
944488
  var init_run_applescript = __esm(() => {
944040
- execFileAsync2 = promisify6(execFile3);
944489
+ execFileAsync2 = promisify7(execFile3);
944041
944490
  });
944042
944491
 
944043
944492
  // ../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js
@@ -944050,7 +944499,7 @@ var init_bundle_name = __esm(() => {
944050
944499
  });
944051
944500
 
944052
944501
  // ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/windows.js
944053
- import { promisify as promisify7 } from "util";
944502
+ import { promisify as promisify8 } from "util";
944054
944503
  import { execFile as execFile4 } from "child_process";
944055
944504
  async function defaultBrowser(_execFileAsync = execFileAsync3) {
944056
944505
  const { stdout: stdout3 } = await _execFileAsync("reg", [
@@ -944072,7 +944521,7 @@ async function defaultBrowser(_execFileAsync = execFileAsync3) {
944072
944521
  }
944073
944522
  var execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError;
944074
944523
  var init_windows2 = __esm(() => {
944075
- execFileAsync3 = promisify7(execFile4);
944524
+ execFileAsync3 = promisify8(execFile4);
944076
944525
  windowsBrowserProgIds = {
944077
944526
  MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
944078
944527
  MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
@@ -944097,7 +944546,7 @@ var init_windows2 = __esm(() => {
944097
944546
  });
944098
944547
 
944099
944548
  // ../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/index.js
944100
- import { promisify as promisify8 } from "util";
944549
+ import { promisify as promisify9 } from "util";
944101
944550
  import process35 from "process";
944102
944551
  import { execFile as execFile5 } from "child_process";
944103
944552
  async function defaultBrowser2() {
@@ -944122,15 +944571,15 @@ var init_default_browser = __esm(() => {
944122
944571
  init_default_browser_id();
944123
944572
  init_bundle_name();
944124
944573
  init_windows2();
944125
- execFileAsync4 = promisify8(execFile5);
944574
+ execFileAsync4 = promisify9(execFile5);
944126
944575
  });
944127
944576
 
944128
944577
  // ../../node_modules/.bun/open@10.2.0/node_modules/open/index.js
944129
944578
  import process36 from "process";
944130
944579
  import { Buffer as Buffer10 } from "buffer";
944131
944580
  import path59 from "path";
944132
- import { fileURLToPath as fileURLToPath16 } from "url";
944133
- import { promisify as promisify9 } from "util";
944581
+ import { fileURLToPath as fileURLToPath17 } from "url";
944582
+ import { promisify as promisify10 } from "util";
944134
944583
  import childProcess3 from "child_process";
944135
944584
  import fs31, { constants as fsConstants2 } from "fs/promises";
944136
944585
  async function getWindowsDefaultBrowserFromWsl() {
@@ -944337,8 +944786,8 @@ var init_open = __esm(() => {
944337
944786
  init_wsl_utils();
944338
944787
  init_default_browser();
944339
944788
  init_is_inside_container();
944340
- execFile6 = promisify9(childProcess3.execFile);
944341
- __dirname4 = path59.dirname(fileURLToPath16(import.meta.url));
944789
+ execFile6 = promisify10(childProcess3.execFile);
944790
+ __dirname4 = path59.dirname(fileURLToPath17(import.meta.url));
944342
944791
  localXdgOpenPath = path59.join(__dirname4, "xdg-open");
944343
944792
  ({ platform: platform4, arch: arch3 } = process36);
944344
944793
  apps = {};
@@ -945542,107 +945991,6 @@ var init_adk_link = __esm(async () => {
945542
945991
  jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
945543
945992
  });
945544
945993
 
945545
- // src/utils/fetch-commands.ts
945546
- import { existsSync as existsSync19, mkdirSync as mkdirSync6, writeFileSync as writeFileSync10 } from "fs";
945547
- import { basename as basename4, join as join27 } from "path";
945548
- function getGithubRawBase() {
945549
- return `https://raw.githubusercontent.com/${REPO}/${getSkillsGitRef()}/${COMMANDS_DIR}`;
945550
- }
945551
- function isManifest(value2) {
945552
- return ManifestSchema.safeParse(value2).success;
945553
- }
945554
- async function fetchWithTimeout(url6, timeoutMs) {
945555
- const controller = new AbortController;
945556
- const timer = setTimeout(() => controller.abort(), timeoutMs);
945557
- try {
945558
- return await fetch(url6, { signal: controller.signal });
945559
- } finally {
945560
- clearTimeout(timer);
945561
- }
945562
- }
945563
- async function fetchManifest() {
945564
- try {
945565
- const res = await fetchWithTimeout(`${getGithubRawBase()}/manifest.json`, REQUEST_TIMEOUT_MS);
945566
- if (!res.ok) {
945567
- return null;
945568
- }
945569
- const data = await res.json();
945570
- if (!isManifest(data)) {
945571
- return null;
945572
- }
945573
- return data;
945574
- } catch {
945575
- return null;
945576
- }
945577
- }
945578
- function listCommandFiles(manifest) {
945579
- if (manifest && manifest.commands.length > 0) {
945580
- return manifest.commands.map((entry) => entry.path);
945581
- }
945582
- return [];
945583
- }
945584
- async function downloadCommand(filePath) {
945585
- try {
945586
- const res = await fetchWithTimeout(`${getGithubRawBase()}/${filePath}`, REQUEST_TIMEOUT_MS);
945587
- if (!res.ok) {
945588
- return null;
945589
- }
945590
- return await res.text();
945591
- } catch {
945592
- return null;
945593
- }
945594
- }
945595
- async function installCommands(projectPath, targets) {
945596
- const result2 = { attempted: true, success: true, installedCommands: 0, failed: 0 };
945597
- const targetPaths = targets.map((t9) => join27(projectPath, TARGET_DIRS[t9]));
945598
- for (const dir of targetPaths) {
945599
- if (!existsSync19(dir)) {
945600
- mkdirSync6(dir, { recursive: true });
945601
- }
945602
- }
945603
- const manifest = await fetchManifest();
945604
- const filenames = listCommandFiles(manifest);
945605
- const downloads = await Promise.all(filenames.map(async (filePath) => {
945606
- const content = await downloadCommand(filePath);
945607
- return { filePath, content };
945608
- }));
945609
- for (const { filePath, content } of downloads) {
945610
- if (content === null) {
945611
- result2.failed += 1;
945612
- continue;
945613
- }
945614
- const outputName = basename4(filePath);
945615
- for (const dir of targetPaths) {
945616
- writeFileSync10(join27(dir, outputName), content);
945617
- }
945618
- result2.installedCommands += 1;
945619
- }
945620
- if (result2.installedCommands === 0) {
945621
- result2.success = false;
945622
- result2.error = "Could not download any command files from GitHub";
945623
- }
945624
- return result2;
945625
- }
945626
- var REPO = "botpress/skills", COMMANDS_DIR = "commands", REQUEST_TIMEOUT_MS = 15000, TARGET_DIRS, ALL_TARGETS, ManifestEntrySchema, ManifestSchema;
945627
- var init_fetch_commands = __esm(() => {
945628
- init_dist5();
945629
- init_skills_ref();
945630
- TARGET_DIRS = {
945631
- "claude-code": ".claude/commands",
945632
- opencode: ".opencode/commands",
945633
- cursor: ".cursor/commands"
945634
- };
945635
- ALL_TARGETS = Object.keys(TARGET_DIRS);
945636
- ManifestEntrySchema = ne.object({
945637
- name: ne.string(),
945638
- path: ne.string(),
945639
- description: ne.string()
945640
- });
945641
- ManifestSchema = ne.object({
945642
- commands: ne.array(ManifestEntrySchema)
945643
- });
945644
- });
945645
-
945646
945994
  // src/commands/adk-init.tsx
945647
945995
  var exports_adk_init = {};
945648
945996
  __export(exports_adk_init, {
@@ -945650,8 +945998,8 @@ __export(exports_adk_init, {
945650
945998
  adkInit: () => adkInit,
945651
945999
  NON_INTERACTIVE_INIT_HINT: () => NON_INTERACTIVE_INIT_HINT
945652
946000
  });
945653
- import { resolve as resolve14, basename as basename5 } from "path";
945654
- import { existsSync as existsSync20 } from "fs";
946001
+ import { resolve as resolve14, basename as basename6 } from "path";
946002
+ import { existsSync as existsSync21 } from "fs";
945655
946003
  function formatInitError(err) {
945656
946004
  if (err instanceof Error)
945657
946005
  return err.message;
@@ -945692,15 +946040,12 @@ function failInitValidation(message, isJson) {
945692
946040
  }
945693
946041
  return logger4.fatal(message);
945694
946042
  }
945695
- function buildNextSteps(projectName, template2, linked) {
946043
+ function buildNextSteps(projectName, linked) {
945696
946044
  const nextSteps = [`cd ${projectName}`];
945697
946045
  if (!linked) {
945698
946046
  nextSteps.push("adk link");
945699
946047
  }
945700
946048
  nextSteps.push("adk dev");
945701
- if (template2 === "hello-world") {
945702
- nextSteps.push("adk chat");
945703
- }
945704
946049
  return nextSteps;
945705
946050
  }
945706
946051
  async function adkInit(nameArg, options) {
@@ -945782,7 +946127,7 @@ Available templates:
945782
946127
  if (!/^[a-zA-Z0-9_-]+$/.test(requestedName)) {
945783
946128
  failInitValidation("Agent name can only contain letters, numbers, hyphens, and underscores", isJson);
945784
946129
  }
945785
- if (existsSync20(resolve14(process.cwd(), requestedName))) {
946130
+ if (existsSync21(resolve14(process.cwd(), requestedName))) {
945786
946131
  failInitValidation(`Directory "${requestedName}" already exists`, isJson);
945787
946132
  }
945788
946133
  }
@@ -945847,7 +946192,7 @@ Initialization cancelled`);
945847
946192
  });
945848
946193
  }
945849
946194
  async function initializeProject(projectPath, template2, packageManager, installCommand, options) {
945850
- const projectName = basename5(projectPath) || "my-agent";
946195
+ const projectName = basename6(projectPath) || "my-agent";
945851
946196
  const isJson = Boolean(options?.json);
945852
946197
  const warnings = [];
945853
946198
  const log6 = createCliLogger({ silent: isJson, level: "debug" });
@@ -945909,65 +946254,89 @@ async function initializeProject(projectPath, template2, packageManager, install
945909
946254
  failed: 0,
945910
946255
  failedRefs: []
945911
946256
  };
945912
- const skillsRunner = packageManager === "bun" ? "bunx" : "npx";
945913
- const skillsCommand = `${skillsRunner} skills add ${getSkillsRepoRef()} -s '*' -a codex claude-code -y`;
945914
- const skills = { attempted: true, success: true, command: skillsCommand };
945915
- const skillsMsg = "Installing ADK skills...";
945916
- const skillsSpinner = isJson ? null : setInterval(() => {
945917
- writeStdout(`\r ${frames[frameIdx++ % frames.length]} ${skillsMsg}`);
946257
+ const upgradeCommand = "adk agent0 upgrade";
946258
+ let capabilitiesInstall;
946259
+ let capabilitiesError;
946260
+ const capabilitiesMsg = "Creating Agent(0) capabilities...";
946261
+ const capabilitiesSpinner = isJson ? null : setInterval(() => {
946262
+ writeStdout(`\r ${frames[frameIdx++ % frames.length]} ${capabilitiesMsg}`);
945918
946263
  }, 80);
945919
946264
  try {
945920
- execSync4(skillsCommand, {
945921
- cwd: projectPath,
945922
- stdio: "pipe",
945923
- env: { ...process.env }
945924
- });
945925
- if (skillsSpinner) {
945926
- clearInterval(skillsSpinner);
946265
+ capabilitiesInstall = await installAgent0Capabilities(projectPath);
946266
+ if (capabilitiesSpinner) {
946267
+ clearInterval(capabilitiesSpinner);
945927
946268
  }
945928
- writeStdout("\r" + " ".repeat(skillsMsg.length + 6) + "\r");
945929
- log6.info("\u2705 ADK skills installed!", "green");
946269
+ writeStdout("\r" + " ".repeat(capabilitiesMsg.length + 6) + "\r");
946270
+ log6.info(`\u2705 Agent(0) capabilities created! (${capabilitiesInstall.skills.installed} skills, ${capabilitiesInstall.playbooks.installed} commands)`, "green");
945930
946271
  } catch (error) {
945931
- skills.success = false;
945932
- const stderr3 = error instanceof Error && "stderr" in error && error.stderr ? String(error.stderr).trim() : undefined;
945933
- skills.error = stderr3 || (error instanceof Error ? error.message : String(error));
945934
- if (skillsSpinner) {
945935
- clearInterval(skillsSpinner);
946272
+ capabilitiesError = error instanceof Error ? error.message : String(error);
946273
+ if (capabilitiesSpinner) {
946274
+ clearInterval(capabilitiesSpinner);
945936
946275
  }
945937
- writeStdout("\r" + " ".repeat(skillsMsg.length + 6) + "\r");
945938
- warnings.push("Failed to install ADK skills automatically.");
945939
- log6.warn("\u26A0\uFE0F Failed to install ADK skills. Run manually:");
945940
- log6.info(` > ${skillsCommand}`, "cyan");
946276
+ writeStdout("\r" + " ".repeat(capabilitiesMsg.length + 6) + "\r");
946277
+ warnings.push("Failed to create Agent(0) capabilities automatically.");
946278
+ log6.warn("\u26A0\uFE0F Failed to create Agent(0) capabilities. Run manually:");
946279
+ log6.info(` > ${upgradeCommand}`, "cyan");
945941
946280
  }
945942
- let commands = { attempted: false, success: false, installedCommands: 0, failed: 0 };
945943
- const commandsMsg = "Installing ADK commands...";
945944
- const commandsSpinner = isJson ? null : setInterval(() => {
945945
- writeStdout(`\r ${frames[frameIdx++ % frames.length]} ${commandsMsg}`);
946281
+ const capabilities = capabilitiesInstall ? {
946282
+ attempted: true,
946283
+ success: true,
946284
+ command: upgradeCommand,
946285
+ capabilitiesRoot: capabilitiesInstall.capabilitiesRoot,
946286
+ manifestPath: capabilitiesInstall.manifestPath,
946287
+ version: capabilitiesInstall.currentVersion,
946288
+ source: capabilitiesInstall.source,
946289
+ skills: capabilitiesInstall.skills.installed,
946290
+ playbooks: capabilitiesInstall.playbooks.installed
946291
+ } : {
946292
+ attempted: true,
946293
+ success: false,
946294
+ command: upgradeCommand,
946295
+ error: capabilitiesError ?? "Failed to create Agent(0) capabilities automatically."
946296
+ };
946297
+ let externalHarness = {
946298
+ success: false,
946299
+ skills: {
946300
+ attempted: true,
946301
+ success: false,
946302
+ command: "",
946303
+ error: "External harness capability installer did not run."
946304
+ },
946305
+ commands: { attempted: false, success: false, installedCommands: 0, failed: 0 }
946306
+ };
946307
+ const externalHarnessMsg = "Installing ADK skills and commands...";
946308
+ const externalHarnessSpinner = isJson ? null : setInterval(() => {
946309
+ writeStdout(`\r ${frames[frameIdx++ % frames.length]} ${externalHarnessMsg}`);
945946
946310
  }, 80);
945947
946311
  try {
945948
- commands = await installCommands(projectPath, ["claude-code", "opencode"]);
945949
- if (commandsSpinner) {
945950
- clearInterval(commandsSpinner);
946312
+ externalHarness = await installExternalHarnessCapabilities({
946313
+ projectPath,
946314
+ packageManagerCommand: packageManager,
946315
+ commandTargets: ["claude-code", "opencode"]
946316
+ });
946317
+ if (externalHarnessSpinner) {
946318
+ clearInterval(externalHarnessSpinner);
945951
946319
  }
945952
- writeStdout("\r" + " ".repeat(commandsMsg.length + 6) + "\r");
945953
- if (commands.success) {
945954
- log6.info(`\u2705 ADK commands installed! (${commands.installedCommands} commands)`, "green");
945955
- } else {
945956
- warnings.push("Failed to install ADK commands automatically.");
945957
- log6.warn("\u26A0\uFE0F Failed to install ADK commands.");
946320
+ writeStdout("\r" + " ".repeat(externalHarnessMsg.length + 6) + "\r");
946321
+ if (externalHarness.success) {
946322
+ log6.info(`\u2705 ADK skills and commands installed! (${externalHarness.commands.installedCommands} commands)`, "green");
945958
946323
  }
945959
946324
  } catch (error) {
945960
- commands = {
945961
- attempted: true,
945962
- success: false,
945963
- installedCommands: 0,
945964
- failed: 0,
945965
- error: error instanceof Error ? error.message : String(error)
945966
- };
945967
- if (commandsSpinner) {
945968
- clearInterval(commandsSpinner);
946325
+ if (externalHarnessSpinner) {
946326
+ clearInterval(externalHarnessSpinner);
945969
946327
  }
945970
- writeStdout("\r" + " ".repeat(commandsMsg.length + 6) + "\r");
946328
+ writeStdout("\r" + " ".repeat(externalHarnessMsg.length + 6) + "\r");
946329
+ externalHarness.skills.error = error instanceof Error ? error.message : String(error);
946330
+ externalHarness.commands.error = error instanceof Error ? error.message : String(error);
946331
+ }
946332
+ const skills = externalHarness.skills;
946333
+ const commands = externalHarness.commands;
946334
+ if (!skills.success) {
946335
+ warnings.push("Failed to install ADK skills automatically.");
946336
+ log6.warn("\u26A0\uFE0F Failed to install ADK skills. Run manually:");
946337
+ log6.info(` > ${skills.command}`, "cyan");
946338
+ }
946339
+ if (!commands.success) {
945971
946340
  warnings.push("Failed to install ADK commands automatically.");
945972
946341
  log6.warn("\u26A0\uFE0F Failed to install ADK commands.");
945973
946342
  }
@@ -946082,10 +946451,11 @@ Linking to Botpress \u2014 connect your agent to a workspace and bot for deploym
946082
946451
  projectPath,
946083
946452
  name: projectName,
946084
946453
  template: template2,
946085
- nextSteps: buildNextSteps(projectName, template2, linked),
946454
+ nextSteps: buildNextSteps(projectName, linked),
946086
946455
  packageManager,
946087
946456
  packageInstall,
946088
946457
  dependencies: dependenciesResult,
946458
+ capabilities,
946089
946459
  skills,
946090
946460
  commands,
946091
946461
  link: link2,
@@ -946096,7 +946466,6 @@ Linking to Botpress \u2014 connect your agent to a workspace and bot for deploym
946096
946466
  }
946097
946467
  const cols = process.stdout.columns || 60;
946098
946468
  const dividerLine = `\u2726 ${"\u2500".repeat(Math.max(10, cols - 4))} \u2726`;
946099
- const separatorLine = " " + "\u2500".repeat(Math.max(10, cols - 2));
946100
946469
  log6.newline();
946101
946470
  log6.debug(dividerLine);
946102
946471
  log6.newline();
@@ -946106,43 +946475,12 @@ Linking to Botpress \u2014 connect your agent to a workspace and bot for deploym
946106
946475
  log6.newline();
946107
946476
  log6.info(` > cd ${projectName}`, "cyan");
946108
946477
  log6.info(" > adk dev", "cyan");
946109
- if (template2 === "hello-world") {
946110
- log6.newline();
946111
- log6.info(" Talk to your agent:");
946112
- log6.newline();
946113
- log6.info(" > adk chat", "cyan");
946114
- log6.debug(" Run this in a separate terminal while adk dev is running.");
946115
- }
946116
946478
  if (!linked) {
946117
946479
  log6.newline();
946118
946480
  log6.error(" \u26A0\uFE0F Your agent is not linked to Botpress.");
946119
946481
  log6.debug(" Run adk link inside the project directory to connect your agent.");
946120
946482
  }
946121
946483
  log6.newline();
946122
- log6.info(" Configure your agent:");
946123
- log6.newline();
946124
- log6.info(" > adk config Interactive configuration", "cyan");
946125
- log6.info(" > adk config:set <key> <value> Set a value non-interactively", "cyan");
946126
- log6.newline();
946127
- log6.debug(separatorLine);
946128
- log6.newline();
946129
- log6.info(" Tips:", "cyan");
946130
- log6.newline();
946131
- if (skills.success && commands.success) {
946132
- log6.info(" ADK skills and commands are installed.");
946133
- log6.info(" AI coding agents now have deep knowledge of ADK.");
946134
- log6.info(" Type /adk- in Claude Code or OpenCode to see available commands.");
946135
- } else if (skills.success) {
946136
- log6.info(" ADK skills are installed, AI coding agents now");
946137
- log6.info(" have deep knowledge of ADK.");
946138
- } else {
946139
- log6.info(" Install agent skills to give AI coding agents deep");
946140
- log6.info(" knowledge of ADK.");
946141
- log6.newline();
946142
- log6.debug(" Install by running:");
946143
- log6.info(` > ${skillsCommand}`, "cyan");
946144
- }
946145
- log6.newline();
946146
946484
  log6.debug(dividerLine);
946147
946485
  log6.newline();
946148
946486
  return result2;
@@ -946159,8 +946497,7 @@ var init_adk_init = __esm(async () => {
946159
946497
  init_dist16();
946160
946498
  init_package_manager();
946161
946499
  init_node_version_check();
946162
- init_fetch_commands();
946163
- init_skills_ref();
946500
+ init_external_harness_capabilities();
946164
946501
  init_telemetry();
946165
946502
  init_logger();
946166
946503
  await __promiseAll([
@@ -946169,25 +946506,26 @@ var init_adk_init = __esm(async () => {
946169
946506
  init_InitWizard(),
946170
946507
  init_adk_login(),
946171
946508
  init_adk_link(),
946172
- init_ensure_templates()
946509
+ init_ensure_templates(),
946510
+ init_agent0_capabilities()
946173
946511
  ]);
946174
946512
  jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
946175
946513
  logger4 = createCliLogger({ level: "debug" });
946176
946514
  });
946177
946515
 
946178
946516
  // src/utils/editor-detector.ts
946179
- import { exec as exec3 } from "child_process";
946180
- import { promisify as promisify10 } from "util";
946517
+ import { exec as exec4 } from "child_process";
946518
+ import { promisify as promisify11 } from "util";
946181
946519
  async function isCursorRunning() {
946182
946520
  try {
946183
946521
  if (process.platform === "darwin") {
946184
- const { stdout: stdout3 } = await execAsync("pgrep -f 'Cursor'");
946522
+ const { stdout: stdout3 } = await execAsync2("pgrep -f 'Cursor'");
946185
946523
  return stdout3.trim().length > 0;
946186
946524
  } else if (process.platform === "win32") {
946187
- const { stdout: stdout3 } = await execAsync('tasklist /FI "IMAGENAME eq Cursor.exe" /NH');
946525
+ const { stdout: stdout3 } = await execAsync2('tasklist /FI "IMAGENAME eq Cursor.exe" /NH');
946188
946526
  return stdout3.includes("Cursor.exe");
946189
946527
  } else {
946190
- const { stdout: stdout3 } = await execAsync("pgrep -f cursor");
946528
+ const { stdout: stdout3 } = await execAsync2("pgrep -f cursor");
946191
946529
  return stdout3.trim().length > 0;
946192
946530
  }
946193
946531
  } catch {
@@ -946197,13 +946535,13 @@ async function isCursorRunning() {
946197
946535
  async function isVSCodeRunning() {
946198
946536
  try {
946199
946537
  if (process.platform === "darwin") {
946200
- const { stdout: stdout3 } = await execAsync("pgrep -f 'Visual Studio Code'");
946538
+ const { stdout: stdout3 } = await execAsync2("pgrep -f 'Visual Studio Code'");
946201
946539
  return stdout3.trim().length > 0;
946202
946540
  } else if (process.platform === "win32") {
946203
- const { stdout: stdout3 } = await execAsync('tasklist /FI "IMAGENAME eq Code.exe" /NH');
946541
+ const { stdout: stdout3 } = await execAsync2('tasklist /FI "IMAGENAME eq Code.exe" /NH');
946204
946542
  return stdout3.includes("Code.exe");
946205
946543
  } else {
946206
- const { stdout: stdout3 } = await execAsync("pgrep -f code");
946544
+ const { stdout: stdout3 } = await execAsync2("pgrep -f code");
946207
946545
  return stdout3.trim().length > 0;
946208
946546
  }
946209
946547
  } catch {
@@ -946243,9 +946581,9 @@ function getAttachInstructions(editor, pid3, launchJsonWritten) {
946243
946581
  ]
946244
946582
  };
946245
946583
  }
946246
- var execAsync;
946584
+ var execAsync2;
946247
946585
  var init_editor_detector = __esm(() => {
946248
- execAsync = promisify10(exec3);
946586
+ execAsync2 = promisify11(exec4);
946249
946587
  });
946250
946588
 
946251
946589
  // src/components/ErrorDisplay.tsx
@@ -946523,7 +946861,7 @@ var init_Separator = __esm(async () => {
946523
946861
  });
946524
946862
 
946525
946863
  // src/components/DevStatus.tsx
946526
- import { exec as exec4 } from "child_process";
946864
+ import { exec as exec5 } from "child_process";
946527
946865
  var import_react39, jsx_dev_runtime19, BlinkingCursor = () => {
946528
946866
  const [visible, setVisible] = import_react39.useState(true);
946529
946867
  const theme = useTheme();
@@ -946612,7 +946950,7 @@ var import_react39, jsx_dev_runtime19, BlinkingCursor = () => {
946612
946950
  }, undefined, true, undefined, this);
946613
946951
  }, openInBrowser = (url6) => {
946614
946952
  const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
946615
- exec4(`${cmd} ${url6}`, () => {});
946953
+ exec5(`${cmd} ${url6}`, () => {});
946616
946954
  }, DevStatus = ({
946617
946955
  project,
946618
946956
  workspace,
@@ -947136,7 +947474,7 @@ var import_react39, jsx_dev_runtime19, BlinkingCursor = () => {
947136
947474
  }
947137
947475
  const dotColor = isReady2 ? theme.status.success : interpolateColor(pulseOpacity);
947138
947476
  const textColor = isReady2 ? theme.text.primary : theme.text.dim;
947139
- const sep9 = /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
947477
+ const sep10 = /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
947140
947478
  color: theme.text.dimmer,
947141
947479
  children: " \u2502 "
947142
947480
  }, undefined, false, undefined, this);
@@ -947154,7 +947492,7 @@ var import_react39, jsx_dev_runtime19, BlinkingCursor = () => {
947154
947492
  statusText
947155
947493
  ]
947156
947494
  }, undefined, true, undefined, this),
947157
- (integrationsText || workerStats) && sep9,
947495
+ (integrationsText || workerStats) && sep10,
947158
947496
  integrationsText && /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(jsx_dev_runtime19.Fragment, {
947159
947497
  children: [
947160
947498
  /* @__PURE__ */ jsx_dev_runtime19.jsxDEV(Text, {
@@ -947275,7 +947613,7 @@ var init_DevStatus = __esm(async () => {
947275
947613
  });
947276
947614
 
947277
947615
  // src/components/LogsView.tsx
947278
- import { readFileSync as readFileSync21, existsSync as existsSync21, statSync as statSync4, watchFile, unwatchFile } from "fs";
947616
+ import { readFileSync as readFileSync24, existsSync as existsSync22, statSync as statSync5, watchFile, unwatchFile } from "fs";
947279
947617
  var import_react40, jsx_dev_runtime20, parseLogLine = (line, lineNumber) => {
947280
947618
  try {
947281
947619
  const parsed = JSON.parse(line);
@@ -947315,17 +947653,17 @@ var import_react40, jsx_dev_runtime20, parseLogLine = (line, lineNumber) => {
947315
947653
  }
947316
947654
  }, { isActive: supportsInput });
947317
947655
  import_react40.useEffect(() => {
947318
- if (!existsSync21(logFilePath)) {
947656
+ if (!existsSync22(logFilePath)) {
947319
947657
  return;
947320
947658
  }
947321
947659
  const checkForNewLogs = () => {
947322
947660
  try {
947323
- const stats = statSync4(logFilePath);
947661
+ const stats = statSync5(logFilePath);
947324
947662
  if (stats.size <= lastSize.current) {
947325
947663
  return;
947326
947664
  }
947327
947665
  lastSize.current = stats.size;
947328
- const content = readFileSync21(logFilePath, "utf-8");
947666
+ const content = readFileSync24(logFilePath, "utf-8");
947329
947667
  const lines = content.split(`
947330
947668
  `);
947331
947669
  const entries = [];
@@ -948328,8 +948666,8 @@ var init_worker_stats = __esm(() => {
948328
948666
  });
948329
948667
 
948330
948668
  // src/server/handlers/agent.ts
948331
- import { existsSync as existsSync22, readFileSync as readFileSync24 } from "fs";
948332
- import { join as join28 } from "path";
948669
+ import { existsSync as existsSync23, readFileSync as readFileSync26 } from "fs";
948670
+ import { join as join29 } from "path";
948333
948671
  async function handleAgentInfo(environment2 = getActiveEnvironment()) {
948334
948672
  const serverConfig2 = getServerConfig();
948335
948673
  if (environment2 === "prod") {
@@ -948344,21 +948682,21 @@ async function handleAgentInfo(environment2 = getActiveEnvironment()) {
948344
948682
  }
948345
948683
  }
948346
948684
  if (!serverConfig2.project) {
948347
- const agentConfigPath = join28(serverConfig2.agentPath, "agent.config.ts");
948348
- const agentJsonPath = join28(serverConfig2.agentPath, "agent.json");
948685
+ const agentConfigPath = join29(serverConfig2.agentPath, "agent.config.ts");
948686
+ const agentJsonPath = join29(serverConfig2.agentPath, "agent.json");
948349
948687
  let agentInfo = {
948350
948688
  path: serverConfig2.agentPath
948351
948689
  };
948352
- if (existsSync22(agentConfigPath)) {
948353
- const configContent = readFileSync24(agentConfigPath, "utf-8");
948690
+ if (existsSync23(agentConfigPath)) {
948691
+ const configContent = readFileSync26(agentConfigPath, "utf-8");
948354
948692
  const nameMatch = configContent.match(/name:\s*['"`]([^'"`]+)['"`]/);
948355
948693
  const versionMatch = configContent.match(/version:\s*['"`]([^'"`]+)['"`]/);
948356
948694
  agentInfo.name = nameMatch?.[1] || "unknown";
948357
948695
  agentInfo.version = versionMatch?.[1] || "0.0.0";
948358
948696
  }
948359
- if (existsSync22(agentJsonPath)) {
948697
+ if (existsSync23(agentJsonPath)) {
948360
948698
  try {
948361
- const agentJson = JSON.parse(readFileSync24(agentJsonPath, "utf-8"));
948699
+ const agentJson = JSON.parse(readFileSync26(agentJsonPath, "utf-8"));
948362
948700
  agentInfo = { ...agentInfo, ...agentJson };
948363
948701
  } catch {}
948364
948702
  }
@@ -948677,8 +949015,8 @@ var init_sse2 = __esm(() => {
948677
949015
  });
948678
949016
 
948679
949017
  // src/server/handlers/source-snippet.ts
948680
- import { readFileSync as readFileSync26 } from "fs";
948681
- import { relative as relative7, resolve as resolve15, sep as sep9 } from "path";
949018
+ import { readFileSync as readFileSync27 } from "fs";
949019
+ import { relative as relative7, resolve as resolve15, sep as sep10 } from "path";
948682
949020
  function inferLanguage(path54) {
948683
949021
  const p4 = path54.toLowerCase();
948684
949022
  if (p4.endsWith(".tsx"))
@@ -948709,7 +949047,7 @@ function resolveSafePath(rawPath, projectRoot) {
948709
949047
  const projectAbs = resolve15(projectRoot);
948710
949048
  const target = resolve15(projectAbs, rawPath);
948711
949049
  const rel = relative7(projectAbs, target);
948712
- if (rel.startsWith("..") || rel.startsWith(`..${sep9}`))
949050
+ if (rel.startsWith("..") || rel.startsWith(`..${sep10}`))
948713
949051
  return null;
948714
949052
  return target;
948715
949053
  }
@@ -948739,7 +949077,7 @@ function handleSourceSnippet(req) {
948739
949077
  }
948740
949078
  let source;
948741
949079
  try {
948742
- source = readFileSync26(absPath, "utf-8");
949080
+ source = readFileSync27(absPath, "utf-8");
948743
949081
  } catch {
948744
949082
  return errorResponse("Not found", `Could not read source file at ${rawPath}`, 404);
948745
949083
  }
@@ -948773,15 +949111,15 @@ var init_source_snippet = __esm(() => {
948773
949111
  });
948774
949112
 
948775
949113
  // src/server/handlers/open-source.ts
948776
- import { existsSync as existsSync23 } from "fs";
948777
- import { relative as relative8, resolve as resolve16, sep as sep10 } from "path";
949114
+ import { existsSync as existsSync24 } from "fs";
949115
+ import { relative as relative8, resolve as resolve16, sep as sep11 } from "path";
948778
949116
  function resolveSafePath2(rawPath, projectRoot) {
948779
949117
  if (!rawPath)
948780
949118
  return null;
948781
949119
  const projectAbs = resolve16(projectRoot);
948782
949120
  const target = resolve16(projectAbs, rawPath);
948783
949121
  const rel = relative8(projectAbs, target);
948784
- if (rel.startsWith("..") || rel.startsWith(`..${sep10}`))
949122
+ if (rel.startsWith("..") || rel.startsWith(`..${sep11}`))
948785
949123
  return null;
948786
949124
  return target;
948787
949125
  }
@@ -948832,7 +949170,7 @@ async function handleOpenSource(req) {
948832
949170
  if (!absPath) {
948833
949171
  return errorResponse("Forbidden", "Requested path is outside the project root", 403);
948834
949172
  }
948835
- if (!existsSync23(absPath)) {
949173
+ if (!existsSync24(absPath)) {
948836
949174
  return errorResponse("Not found", `Could not find source file at ${body.path}`, 404);
948837
949175
  }
948838
949176
  const line = positiveInt(body.line, 1);
@@ -948861,8 +949199,8 @@ var init_open_source = __esm(() => {
948861
949199
 
948862
949200
  // src/utils/sqlite-trace-store.ts
948863
949201
  import { Database } from "bun:sqlite";
948864
- import { mkdirSync as mkdirSync7 } from "fs";
948865
- import { join as join29 } from "path";
949202
+ import { mkdirSync as mkdirSync8 } from "fs";
949203
+ import { join as join30 } from "path";
948866
949204
  function rowToSpan(row) {
948867
949205
  return {
948868
949206
  id: {
@@ -948893,13 +949231,13 @@ class SqliteTraceStore {
948893
949231
  insertStmt = null;
948894
949232
  updateStmt = null;
948895
949233
  constructor(agentPath) {
948896
- this.tracesDir = agentPath ? join29(agentPath, ".adk", "bot", "traces") : process.env.TRACE_DIR ?? "traces";
948897
- this.dbPath = join29(this.tracesDir, "traces.db");
949234
+ this.tracesDir = agentPath ? join30(agentPath, ".adk", "bot", "traces") : process.env.TRACE_DIR ?? "traces";
949235
+ this.dbPath = join30(this.tracesDir, "traces.db");
948898
949236
  }
948899
949237
  getDb() {
948900
949238
  if (this.db)
948901
949239
  return this.db;
948902
- mkdirSync7(this.tracesDir, { recursive: true });
949240
+ mkdirSync8(this.tracesDir, { recursive: true });
948903
949241
  try {
948904
949242
  this.db = new Database(this.dbPath);
948905
949243
  this.db.exec("PRAGMA journal_mode=WAL");
@@ -949817,15 +950155,15 @@ var init_inspector = __esm(() => {
949817
950155
  });
949818
950156
 
949819
950157
  // src/utils/project-paths.ts
949820
- import { relative as relative9, resolve as resolve17, sep as sep11 } from "path";
950158
+ import { relative as relative9, resolve as resolve17, sep as sep12 } from "path";
949821
950159
  function isInsideProject(absPath, projectRoot) {
949822
950160
  const rel = relative9(resolve17(projectRoot), resolve17(absPath));
949823
- return rel !== "" && !rel.startsWith("..") && !rel.startsWith(`..${sep11}`);
950161
+ return rel !== "" && !rel.startsWith("..") && !rel.startsWith(`..${sep12}`);
949824
950162
  }
949825
950163
  var init_project_paths = () => {};
949826
950164
 
949827
950165
  // src/server/handlers/components.ts
949828
- import { existsSync as existsSync24, mkdirSync as mkdirSync8, readFileSync as readFileSync27, writeFileSync as writeFileSync11 } from "fs";
950166
+ import { existsSync as existsSync25, mkdirSync as mkdirSync9, readFileSync as readFileSync28, writeFileSync as writeFileSync12 } from "fs";
949829
950167
  import { relative as relative10, resolve as resolve18 } from "path";
949830
950168
  function isJsonSafePlainObject(value2) {
949831
950169
  if (!value2 || typeof value2 !== "object" || Array.isArray(value2))
@@ -949934,18 +950272,18 @@ async function handleAddRegistryComponentToBot(req) {
949934
950272
  const bpCssPath = resolve18(bpDir, `${exportName}${BP_CSS_SUFFIX}`);
949935
950273
  const baseStylesPath = resolve18(componentsDir, BASE_STYLES_FILENAME);
949936
950274
  const indexPath = resolve18(componentsDir, "index.ts");
949937
- if (existsSync24(bpDir)) {
950275
+ if (existsSync25(bpDir)) {
949938
950276
  return errorResponse("Conflict", `${exportName}/ already exists in ${COMPONENTS_DIR}`, 409);
949939
950277
  }
949940
950278
  let existingIndex = null;
949941
- if (existsSync24(indexPath)) {
949942
- existingIndex = readFileSync27(indexPath, "utf-8");
950279
+ if (existsSync25(indexPath)) {
950280
+ existingIndex = readFileSync28(indexPath, "utf-8");
949943
950281
  const conflict = findConflictingExport(existingIndex, exportName);
949944
950282
  if (conflict) {
949945
950283
  return errorResponse("Conflict", `${conflict} is already exported from index.ts`, 409);
949946
950284
  }
949947
950285
  }
949948
- const writeBaseStyles = baseStylesUrl !== null && !existsSync24(baseStylesPath);
950286
+ const writeBaseStyles = baseStylesUrl !== null && !existsSync25(baseStylesPath);
949949
950287
  let componentText;
949950
950288
  let typesText;
949951
950289
  let cssText = null;
@@ -949974,20 +950312,20 @@ async function handleAddRegistryComponentToBot(req) {
949974
950312
  const sourceWithImports = prependedImports.length > 0 ? `${prependedImports.join(`
949975
950313
  `)}
949976
950314
  ${rewrittenComponent}` : rewrittenComponent;
949977
- mkdirSync8(bpDir, { recursive: true });
949978
- writeFileSync11(bpTsxPath, sourceWithImports, "utf-8");
949979
- writeFileSync11(bpTypesPath, typesText, "utf-8");
950315
+ mkdirSync9(bpDir, { recursive: true });
950316
+ writeFileSync12(bpTsxPath, sourceWithImports, "utf-8");
950317
+ writeFileSync12(bpTypesPath, typesText, "utf-8");
949980
950318
  if (cssUrl && cssText !== null)
949981
- writeFileSync11(bpCssPath, cssText, "utf-8");
950319
+ writeFileSync12(bpCssPath, cssText, "utf-8");
949982
950320
  if (writeBaseStyles && baseStylesText !== null)
949983
- writeFileSync11(baseStylesPath, baseStylesText, "utf-8");
950321
+ writeFileSync12(baseStylesPath, baseStylesText, "utf-8");
949984
950322
  const llm = propsSchemaExport && exampleValues && exampleValues.length > 0 ? { description: `TODO: describe ${exportName}`, propsSchemaExport, exampleValues } : null;
949985
950323
  const nextIndex = buildIndexUpdate({
949986
950324
  existing: existingIndex,
949987
950325
  exportName,
949988
950326
  llm
949989
950327
  });
949990
- writeFileSync11(indexPath, nextIndex, "utf-8");
950328
+ writeFileSync12(indexPath, nextIndex, "utf-8");
949991
950329
  return successResponse({
949992
950330
  ok: true,
949993
950331
  bpTsxPath: relative10(project.path, bpTsxPath),
@@ -950253,7 +950591,7 @@ var init_component_builder = __esm(() => {
950253
950591
  });
950254
950592
 
950255
950593
  // src/server/handlers/component-bundle.ts
950256
- import { existsSync as existsSync25 } from "fs";
950594
+ import { existsSync as existsSync26 } from "fs";
950257
950595
  import { resolve as resolve19 } from "path";
950258
950596
  function resolveSource(req) {
950259
950597
  const project = getServerConfig().project;
@@ -950270,7 +950608,7 @@ function resolveSource(req) {
950270
950608
  if (!isInsideProject(abs, project.path)) {
950271
950609
  return { error: "`source` escapes the project root", status: 400 };
950272
950610
  }
950273
- if (!existsSync25(abs))
950611
+ if (!existsSync26(abs))
950274
950612
  return { error: `Source file missing: ${posix8}`, status: 404 };
950275
950613
  return { abs };
950276
950614
  }
@@ -950348,9 +950686,9 @@ var init_component_events = __esm(() => {
950348
950686
  });
950349
950687
 
950350
950688
  // src/server/handlers/memory.ts
950351
- import { mkdirSync as mkdirSync9 } from "fs";
950689
+ import { mkdirSync as mkdirSync10 } from "fs";
950352
950690
  import { tmpdir } from "os";
950353
- import { join as join30 } from "path";
950691
+ import { join as join31 } from "path";
950354
950692
  import v8 from "v8";
950355
950693
  async function handleMemoryDebug() {
950356
950694
  const usage = process.memoryUsage();
@@ -950406,8 +950744,8 @@ async function handleMemorySnapshot() {
950406
950744
  return errorResponse("Heap snapshots unavailable", "Heap snapshots only available in Bun runtime", 501);
950407
950745
  }
950408
950746
  const tempDir = tmpdir();
950409
- mkdirSync9(tempDir, { recursive: true });
950410
- const filename = join30(tempDir, `heap-${Date.now()}.json`);
950747
+ mkdirSync10(tempDir, { recursive: true });
950748
+ const filename = join31(tempDir, `heap-${Date.now()}.json`);
950411
950749
  try {
950412
950750
  const snapshot = Bun.generateHeapSnapshot();
950413
950751
  await Bun.write(filename, JSON.stringify(snapshot));
@@ -950426,8 +950764,8 @@ async function handleMemorySnapshot() {
950426
950764
  }
950427
950765
  async function handleMemorySnapshotV8() {
950428
950766
  const tempDir = tmpdir();
950429
- mkdirSync9(tempDir, { recursive: true });
950430
- const filename = join30(tempDir, `heap-v8-${Date.now()}.heapsnapshot`);
950767
+ mkdirSync10(tempDir, { recursive: true });
950768
+ const filename = join31(tempDir, `heap-v8-${Date.now()}.heapsnapshot`);
950431
950769
  try {
950432
950770
  const snapshotPath = v8.writeHeapSnapshot(filename);
950433
950771
  if (typeof Bun !== "undefined" && Bun.gc) {
@@ -950452,7 +950790,7 @@ var init_memory2 = __esm(async () => {
950452
950790
  });
950453
950791
 
950454
950792
  // ../evals/dist/loader.js
950455
- import { readdirSync as readdirSync7, existsSync as existsSync26 } from "fs";
950793
+ import { readdirSync as readdirSync8, existsSync as existsSync27 } from "fs";
950456
950794
  import { resolve as resolve20 } from "path";
950457
950795
  function isEvalDefinition(value2) {
950458
950796
  return value2 !== null && typeof value2 === "object" && typeof value2.name === "string" && value2.name !== "" && Array.isArray(value2.conversation);
@@ -950486,10 +950824,10 @@ Make sure your eval file:
950486
950824
  }
950487
950825
  async function loadEvalsFromDir(dirPath) {
950488
950826
  const absDir = resolve20(dirPath);
950489
- if (!existsSync26(absDir)) {
950827
+ if (!existsSync27(absDir)) {
950490
950828
  return [];
950491
950829
  }
950492
- const files = readdirSync7(absDir).filter((f5) => f5.endsWith(".eval.ts"));
950830
+ const files = readdirSync8(absDir).filter((f5) => f5.endsWith(".eval.ts"));
950493
950831
  const evals = [];
950494
950832
  for (const f5 of files) {
950495
950833
  const defs = await loadEvalFile(`${absDir}/${f5}`);
@@ -950506,9 +950844,9 @@ async function loadEvalsFromDir(dirPath) {
950506
950844
  }
950507
950845
  async function loadEvalByName(dirPath, name2) {
950508
950846
  const absDir = resolve20(dirPath);
950509
- if (!existsSync26(absDir))
950847
+ if (!existsSync27(absDir))
950510
950848
  return null;
950511
- const files = readdirSync7(absDir).filter((f5) => f5.endsWith(".eval.ts"));
950849
+ const files = readdirSync8(absDir).filter((f5) => f5.endsWith(".eval.ts"));
950512
950850
  for (const f5 of files) {
950513
950851
  const defs = await loadEvalFile(`${absDir}/${f5}`);
950514
950852
  const found = defs.find((d5) => d5.name === name2);
@@ -950566,7 +950904,7 @@ var init_loader = () => {};
950566
950904
 
950567
950905
  // ../evals/dist/runner.js
950568
950906
  import { createRequire as createRequire4 } from "module";
950569
- import { readdirSync as readdirSync8, existsSync as existsSync27 } from "fs";
950907
+ import { readdirSync as readdirSync9, existsSync as existsSync28 } from "fs";
950570
950908
  import { resolve as resolve21 } from "path";
950571
950909
  import { randomUUID } from "crypto";
950572
950910
  function getDefaultChatClient() {
@@ -951215,10 +951553,10 @@ Make sure your eval file:
951215
951553
  }
951216
951554
  async function loadEvalsFromDir2(dirPath) {
951217
951555
  const absDir = resolve21(dirPath);
951218
- if (!existsSync27(absDir)) {
951556
+ if (!existsSync28(absDir)) {
951219
951557
  return [];
951220
951558
  }
951221
- const files = readdirSync8(absDir).filter((f5) => f5.endsWith(".eval.ts"));
951559
+ const files = readdirSync9(absDir).filter((f5) => f5.endsWith(".eval.ts"));
951222
951560
  const evals = [];
951223
951561
  for (const f5 of files) {
951224
951562
  const defs = await loadEvalFile2(`${absDir}/${f5}`);
@@ -951987,8 +952325,8 @@ var init_runner = __esm(() => {
951987
952325
 
951988
952326
  // src/eval/sqlite-eval-store.ts
951989
952327
  import { Database as Database2 } from "bun:sqlite";
951990
- import { existsSync as existsSync28, mkdirSync as mkdirSync10, readdirSync as readdirSync9, readFileSync as readFileSync28, renameSync as renameSync2 } from "fs";
951991
- import { join as join31 } from "path";
952328
+ import { existsSync as existsSync29, mkdirSync as mkdirSync11, readdirSync as readdirSync10, readFileSync as readFileSync29, renameSync as renameSync2 } from "fs";
952329
+ import { join as join32 } from "path";
951992
952330
  function aggregateTurnTimings(report) {
951993
952331
  let botDuration = 0;
951994
952332
  let evalDuration = 0;
@@ -952008,13 +952346,13 @@ class SqliteEvalStore {
952008
952346
  insertRunStmt = null;
952009
952347
  insertReportStmt = null;
952010
952348
  constructor(agentPath) {
952011
- this.evalsDir = join31(agentPath, ".adk", "evals");
952012
- this.dbPath = join31(this.evalsDir, "evals.db");
952349
+ this.evalsDir = join32(agentPath, ".adk", "evals");
952350
+ this.dbPath = join32(this.evalsDir, "evals.db");
952013
952351
  }
952014
952352
  getDb() {
952015
952353
  if (this.db)
952016
952354
  return this.db;
952017
- mkdirSync10(this.evalsDir, { recursive: true });
952355
+ mkdirSync11(this.evalsDir, { recursive: true });
952018
952356
  try {
952019
952357
  this.db = new Database2(this.dbPath);
952020
952358
  this.db.run("PRAGMA journal_mode=WAL");
@@ -952042,7 +952380,7 @@ class SqliteEvalStore {
952042
952380
  this.db?.close();
952043
952381
  } catch {}
952044
952382
  try {
952045
- if (existsSync28(this.dbPath)) {
952383
+ if (existsSync29(this.dbPath)) {
952046
952384
  renameSync2(this.dbPath, `${this.dbPath}.corrupt-${Date.now()}`);
952047
952385
  }
952048
952386
  } catch {}
@@ -952071,14 +952409,14 @@ class SqliteEvalStore {
952071
952409
  return;
952072
952410
  if (this.getMeta("imported_legacy") === "1")
952073
952411
  return;
952074
- const legacyDir = join31(this.evalsDir, "runs");
952075
- if (!existsSync28(legacyDir)) {
952412
+ const legacyDir = join32(this.evalsDir, "runs");
952413
+ if (!existsSync29(legacyDir)) {
952076
952414
  this.setMeta("imported_legacy", "1");
952077
952415
  return;
952078
952416
  }
952079
952417
  let files = [];
952080
952418
  try {
952081
- files = readdirSync9(legacyDir).filter((f5) => f5.endsWith(".json"));
952419
+ files = readdirSync10(legacyDir).filter((f5) => f5.endsWith(".json"));
952082
952420
  } catch (err) {
952083
952421
  console.warn("[sqlite-eval-store] Could not read legacy runs dir:", err);
952084
952422
  return;
@@ -952094,7 +952432,7 @@ class SqliteEvalStore {
952094
952432
  for (const file of files) {
952095
952433
  db4.run("SAVEPOINT import_file");
952096
952434
  try {
952097
- const raw = readFileSync28(join31(legacyDir, file), "utf-8");
952435
+ const raw = readFileSync29(join32(legacyDir, file), "utf-8");
952098
952436
  const report = JSON.parse(raw);
952099
952437
  this.insertRunReport(report);
952100
952438
  db4.run("RELEASE import_file");
@@ -952114,7 +952452,7 @@ class SqliteEvalStore {
952114
952452
  return;
952115
952453
  }
952116
952454
  try {
952117
- renameSync2(legacyDir, join31(this.evalsDir, "runs.json-migrated"));
952455
+ renameSync2(legacyDir, join32(this.evalsDir, "runs.json-migrated"));
952118
952456
  } catch (err) {
952119
952457
  console.warn("[sqlite-eval-store] Could not rename legacy runs dir:", err);
952120
952458
  }
@@ -952374,13 +952712,13 @@ var init_store = __esm(() => {
952374
952712
  });
952375
952713
 
952376
952714
  // src/utils/dev-server.ts
952377
- import { readFileSync as readFileSync29, existsSync as existsSync29, accessSync } from "fs";
952378
- import { dirname as dirname11, join as join32, parse as parse9, resolve as resolve23 } from "path";
952715
+ import { readFileSync as readFileSync30, existsSync as existsSync30, accessSync } from "fs";
952716
+ import { dirname as dirname12, join as join33, parse as parse9, resolve as resolve23 } from "path";
952379
952717
  import { homedir as homedir10 } from "os";
952380
952718
  function getDevServerUrl() {
952381
- if (existsSync29(CONSOLE_PORT_FILE2)) {
952719
+ if (existsSync30(CONSOLE_PORT_FILE2)) {
952382
952720
  try {
952383
- const port = parseInt(readFileSync29(CONSOLE_PORT_FILE2, "utf-8").trim(), 10);
952721
+ const port = parseInt(readFileSync30(CONSOLE_PORT_FILE2, "utf-8").trim(), 10);
952384
952722
  if (port > 0)
952385
952723
  return `http://localhost:${port}`;
952386
952724
  } catch {}
@@ -952392,10 +952730,10 @@ function resolveAgentRoot(cwd3 = process.cwd()) {
952392
952730
  const root4 = parse9(currentPath).root;
952393
952731
  while (currentPath !== root4) {
952394
952732
  try {
952395
- accessSync(join32(currentPath, "agent.config.ts"));
952733
+ accessSync(join33(currentPath, "agent.config.ts"));
952396
952734
  return currentPath;
952397
952735
  } catch {
952398
- currentPath = dirname11(currentPath);
952736
+ currentPath = dirname12(currentPath);
952399
952737
  }
952400
952738
  }
952401
952739
  return null;
@@ -952470,7 +952808,7 @@ async function getDevServerWorkflow(name2, headers = getDevServerHeaders()) {
952470
952808
  }
952471
952809
  var DEFAULT_DEV_SERVER_PORT = 3001, HEALTH_TIMEOUT_MS = 2000, REQUEST_TIMEOUT_MS2 = 5000, CONSOLE_PORT_FILE2, DEV_SERVER_DOWN_ERROR = "Dev server not running \u2014 start with `adk dev`", cachedHeaders;
952472
952810
  var init_dev_server = __esm(() => {
952473
- CONSOLE_PORT_FILE2 = join32(homedir10(), ".adk", "console.port");
952811
+ CONSOLE_PORT_FILE2 = join33(homedir10(), ".adk", "console.port");
952474
952812
  });
952475
952813
 
952476
952814
  // src/server/handlers/evals.ts
@@ -953369,16 +953707,16 @@ var init_filter_tokens = __esm(() => {
953369
953707
  import {
953370
953708
  closeSync,
953371
953709
  createReadStream as createReadStream4,
953372
- existsSync as existsSync30,
953710
+ existsSync as existsSync31,
953373
953711
  openSync,
953374
- readFileSync as readFileSync30,
953712
+ readFileSync as readFileSync31,
953375
953713
  readSync,
953376
- readdirSync as readdirSync10,
953377
- statSync as statSync5,
953714
+ readdirSync as readdirSync11,
953715
+ statSync as statSync6,
953378
953716
  watch as watch3
953379
953717
  } from "fs";
953380
953718
  import { createInterface as createInterface2 } from "readline";
953381
- import { join as join33 } from "path";
953719
+ import { join as join34 } from "path";
953382
953720
  function normalizeLevel(type) {
953383
953721
  const lower = type.toLowerCase();
953384
953722
  if (lower === "error")
@@ -953390,14 +953728,14 @@ function normalizeLevel(type) {
953390
953728
  return lower;
953391
953729
  }
953392
953730
  function findLatestLogFile(agentRoot) {
953393
- const logsDir = join33(agentRoot, ".adk", "logs");
953394
- if (!existsSync30(logsDir))
953731
+ const logsDir = join34(agentRoot, ".adk", "logs");
953732
+ if (!existsSync31(logsDir))
953395
953733
  return null;
953396
953734
  try {
953397
- const files = readdirSync10(logsDir).filter((f5) => f5.startsWith("adk-dev-") && f5.endsWith(".log")).map((f5) => ({
953735
+ const files = readdirSync11(logsDir).filter((f5) => f5.startsWith("adk-dev-") && f5.endsWith(".log")).map((f5) => ({
953398
953736
  name: f5,
953399
- path: join33(logsDir, f5),
953400
- mtime: statSync5(join33(logsDir, f5)).mtime.getTime()
953737
+ path: join34(logsDir, f5),
953738
+ mtime: statSync6(join34(logsDir, f5)).mtime.getTime()
953401
953739
  })).sort((a7, b7) => b7.mtime - a7.mtime);
953402
953740
  return files.length > 0 ? files[0].path : null;
953403
953741
  } catch {
@@ -953457,14 +953795,14 @@ function filterLogEntries(entries, options) {
953457
953795
  }
953458
953796
  function readRecentLogs(options) {
953459
953797
  const logFile = options.logFile || findLatestLogFile(options.agentRoot);
953460
- if (!logFile || !existsSync30(logFile))
953798
+ if (!logFile || !existsSync31(logFile))
953461
953799
  return [];
953462
953800
  const limit = options.limit ?? 50;
953463
953801
  if (limit <= 0)
953464
953802
  return [];
953465
953803
  let fileDescriptor = null;
953466
953804
  try {
953467
- const fileSize = statSync5(logFile).size;
953805
+ const fileSize = statSync6(logFile).size;
953468
953806
  if (fileSize === 0)
953469
953807
  return [];
953470
953808
  fileDescriptor = openSync(logFile, "r");
@@ -953511,11 +953849,11 @@ function readRecentLogs(options) {
953511
953849
  }
953512
953850
  function readLogs(options) {
953513
953851
  const logFile = options.logFile || findLatestLogFile(options.agentRoot);
953514
- if (!logFile || !existsSync30(logFile))
953852
+ if (!logFile || !existsSync31(logFile))
953515
953853
  return [];
953516
953854
  const limit = options.limit ?? 50;
953517
953855
  try {
953518
- const content = readFileSync30(logFile, "utf-8");
953856
+ const content = readFileSync31(logFile, "utf-8");
953519
953857
  const lines = content.split(`
953520
953858
  `);
953521
953859
  const entries = [];
@@ -953546,7 +953884,7 @@ function followLogs(options) {
953546
953884
  resolveNext = null;
953547
953885
  }
953548
953886
  };
953549
- if (!logFile || !existsSync30(logFile)) {
953887
+ if (!logFile || !existsSync31(logFile)) {
953550
953888
  return {
953551
953889
  entries: {
953552
953890
  [Symbol.asyncIterator]() {
@@ -953560,7 +953898,7 @@ function followLogs(options) {
953560
953898
  stop
953561
953899
  };
953562
953900
  }
953563
- let byteOffset = statSync5(logFile).size;
953901
+ let byteOffset = statSync6(logFile).size;
953564
953902
  let watcher = null;
953565
953903
  let processing = false;
953566
953904
  const processNewBytes = async () => {
@@ -953568,9 +953906,9 @@ function followLogs(options) {
953568
953906
  return;
953569
953907
  processing = true;
953570
953908
  try {
953571
- if (!existsSync30(logFile))
953909
+ if (!existsSync31(logFile))
953572
953910
  return;
953573
- const currentSize = statSync5(logFile).size;
953911
+ const currentSize = statSync6(logFile).size;
953574
953912
  if (currentSize <= byteOffset)
953575
953913
  return;
953576
953914
  const stream9 = createReadStream4(logFile, {
@@ -953634,7 +953972,7 @@ function isDevServerLikelyRunning(agentRoot) {
953634
953972
  if (!logFile)
953635
953973
  return false;
953636
953974
  try {
953637
- const mtime = statSync5(logFile).mtime.getTime();
953975
+ const mtime = statSync6(logFile).mtime.getTime();
953638
953976
  return Date.now() - mtime < 30000;
953639
953977
  } catch {
953640
953978
  return false;
@@ -954128,8 +954466,8 @@ var init_logs2 = __esm(() => {
954128
954466
  });
954129
954467
 
954130
954468
  // src/server/routes/streaming.ts
954131
- import { existsSync as existsSync31, readFileSync as readFileSync31 } from "fs";
954132
- import { dirname as dirname12 } from "path";
954469
+ import { existsSync as existsSync33, readFileSync as readFileSync32 } from "fs";
954470
+ import { dirname as dirname13 } from "path";
954133
954471
  function broadcastSpan(span5) {
954134
954472
  for (const sub of subscribers3) {
954135
954473
  sub([span5]);
@@ -954213,14 +954551,14 @@ function handleSSEStream(req) {
954213
954551
  });
954214
954552
  }
954215
954553
  function streamLogs(logFilePath, req) {
954216
- const agentRoot = dirname12(dirname12(dirname12(logFilePath)));
954554
+ const agentRoot = dirname13(dirname13(dirname13(logFilePath)));
954217
954555
  let handle = null;
954218
954556
  return createSSEStream(req, {
954219
954557
  onConnect(client5) {
954220
954558
  const run = async () => {
954221
954559
  try {
954222
- if (existsSync31(logFilePath)) {
954223
- const content = readFileSync31(logFilePath, "utf-8");
954560
+ if (existsSync33(logFilePath)) {
954561
+ const content = readFileSync32(logFilePath, "utf-8");
954224
954562
  for (const line of content.split(`
954225
954563
  `)) {
954226
954564
  const entry = parseLine(line);
@@ -954917,9 +955255,9 @@ var init_agent0_status = __esm(() => {
954917
955255
  });
954918
955256
 
954919
955257
  // ../adk/dist/agent0/index.js
954920
- import { existsSync as existsSync33, readdirSync as readdirSync11, readFileSync as readFileSync32, statSync as statSync6 } from "fs";
954921
- import { basename as basename6, dirname as dirname13, extname as extname3, join as join34 } from "path";
954922
- import { fileURLToPath as fileURLToPath17 } from "url";
955258
+ import { existsSync as existsSync35, readdirSync as readdirSync12, readFileSync as readFileSync33, statSync as statSync7 } from "fs";
955259
+ import { basename as basename7, dirname as dirname14, extname as extname4, join as join35 } from "path";
955260
+ import { fileURLToPath as fileURLToPath18 } from "url";
954923
955261
  import { createHash as createHash7 } from "crypto";
954924
955262
  import { existsSync as existsSync210, realpathSync as realpathSync7 } from "fs";
954925
955263
  import { chmod, mkdir as mkdir7 } from "fs/promises";
@@ -954929,16 +955267,17 @@ import { readFile as readFile10, rename as rename4, writeFile as writeFile8, chm
954929
955267
  import { dirname as dirname23 } from "path";
954930
955268
  import { execFileSync as execFileSync3, spawn as spawn7 } from "child_process";
954931
955269
  import { randomUUID as randomUUID2 } from "crypto";
954932
- import { chmodSync as chmodSync2, copyFileSync as copyFileSync2, createWriteStream as createWriteStream4, existsSync as existsSync34, mkdirSync as mkdirSync11, renameSync as renameSync3, rmSync } from "fs";
955270
+ import { chmodSync as chmodSync2, copyFileSync as copyFileSync3, createWriteStream as createWriteStream4, existsSync as existsSync34, mkdirSync as mkdirSync12, renameSync as renameSync3, rmSync as rmSync2 } from "fs";
954933
955271
  import { createRequire as createRequire23 } from "module";
954934
955272
  import { arch as arch5, homedir as homedir22, platform as platform23, tmpdir as tmpdir2 } from "os";
954935
955273
  import { delimiter as delimiter2, dirname as dirname32, join as join42, resolve as resolve24 } from "path";
954936
955274
  import { pipeline } from "stream/promises";
954937
955275
  import { chmod as chmod3, mkdir as mkdir22, writeFile as writeFile22 } from "fs/promises";
954938
955276
  import { platform as platform5 } from "os";
954939
- import { join as join35 } from "path";
955277
+ import { join as join36 } from "path";
954940
955278
  function buildAgent0BuiltInCapabilities(options) {
954941
- const skillsRoot = resolveAgent0BuiltInSkillsRoot();
955279
+ const skillsRoot = resolveAgent0ProjectSkillsRoot(options.agentPath);
955280
+ const commandsRoot = resolveAgent0ProjectPlaybooksRoot(options.agentPath);
954942
955281
  return {
954943
955282
  mcp: {
954944
955283
  adk: {
@@ -954948,11 +955287,11 @@ function buildAgent0BuiltInCapabilities(options) {
954948
955287
  }
954949
955288
  },
954950
955289
  skills: {
954951
- paths: resolveAgent0BuiltInSkillPaths(skillsRoot),
955290
+ paths: skillsRoot ? resolveAgent0BuiltInSkillPaths(skillsRoot) : [],
954952
955291
  urls: []
954953
955292
  },
954954
- instructions: resolveAgent0BuiltInInstructionFiles(skillsRoot),
954955
- command: loadAgent0BuiltInCommandConfig(),
955293
+ instructions: skillsRoot ? resolveAgent0BuiltInInstructionFiles(skillsRoot) : [],
955294
+ command: commandsRoot ? loadAgent0BuiltInCommandConfig(commandsRoot) : {},
954956
955295
  agent: {
954957
955296
  default: {
954958
955297
  description: "Agent(0) - helps build and debug Botpress ADK agents",
@@ -954982,40 +955321,49 @@ function buildAgent0BuiltInCapabilities(options) {
954982
955321
  defaultAgent: AGENT0_DEFAULT_AGENT
954983
955322
  };
954984
955323
  }
955324
+ function getAgent0ProjectCapabilitiesRoot2(projectPath) {
955325
+ return join35(projectPath, AGENT0_PROJECT_DIR2, AGENT0_PROJECT_CAPABILITIES_DIR2);
955326
+ }
955327
+ function resolveAgent0ProjectSkillsRoot(projectPath) {
955328
+ return firstExistingDirectory2([join35(getAgent0ProjectCapabilitiesRoot2(projectPath), AGENT0_PROJECT_SKILLS_DIR2)]);
955329
+ }
955330
+ function resolveAgent0ProjectPlaybooksRoot(projectPath) {
955331
+ return firstExistingDirectory2([join35(getAgent0ProjectCapabilitiesRoot2(projectPath), AGENT0_PROJECT_PLAYBOOKS_DIR2)]);
955332
+ }
954985
955333
  function resolveAgent0BuiltInSkillsRoot() {
954986
- return firstExistingDirectory(resolveAgent0BuiltInSkillsRootCandidates(moduleDir()));
955334
+ return firstExistingDirectory2(resolveAgent0BuiltInSkillsRootCandidates(moduleDir2()));
954987
955335
  }
954988
955336
  function resolveAgent0BuiltInCommandsRoot() {
954989
- return firstExistingDirectory(resolveAgent0BuiltInCommandsRootCandidates(moduleDir()));
955337
+ return firstExistingDirectory2(resolveAgent0BuiltInCommandsRootCandidates(moduleDir2()));
954990
955338
  }
954991
955339
  function resolveAgent0BuiltInSkillPaths(skillsRoot = resolveAgent0BuiltInSkillsRoot()) {
954992
955340
  if (!skillsRoot)
954993
955341
  return [];
954994
- return readdirSync11(skillsRoot).toSorted().flatMap((entry) => {
954995
- const dir = join34(skillsRoot, entry);
954996
- if (!statSync6(dir).isDirectory())
955342
+ return readdirSync12(skillsRoot).toSorted().flatMap((entry) => {
955343
+ const dir = join35(skillsRoot, entry);
955344
+ if (!statSync7(dir).isDirectory())
954997
955345
  return [];
954998
- if (!existsSync33(join34(dir, "SKILL.md")))
955346
+ if (!existsSync35(join35(dir, "SKILL.md")))
954999
955347
  return [];
955000
955348
  return [dir];
955001
955349
  });
955002
955350
  }
955003
955351
  function resolveAgent0BuiltInInstructionFiles(skillsRoot = resolveAgent0BuiltInSkillsRoot()) {
955004
- const files = skillsRoot ? [join34(skillsRoot, "adk", "SKILL.md")] : [];
955005
- return files.filter((file) => existsSync33(file) && statSync6(file).isFile());
955352
+ const files = skillsRoot ? [join35(skillsRoot, "adk", "SKILL.md")] : [];
955353
+ return files.filter((file) => existsSync35(file) && statSync7(file).isFile());
955006
955354
  }
955007
955355
  function loadAgent0BuiltInCommandConfig(commandsRoot = resolveAgent0BuiltInCommandsRoot()) {
955008
955356
  if (!commandsRoot)
955009
955357
  return {};
955010
955358
  const commands = {};
955011
- for (const file of readdirSync11(commandsRoot).toSorted()) {
955012
- if (extname3(file) !== ".md")
955359
+ for (const file of readdirSync12(commandsRoot).toSorted()) {
955360
+ if (extname4(file) !== ".md")
955013
955361
  continue;
955014
- const filepath = join34(commandsRoot, file);
955015
- if (!statSync6(filepath).isFile())
955362
+ const filepath = join35(commandsRoot, file);
955363
+ if (!statSync7(filepath).isFile())
955016
955364
  continue;
955017
- const parsed = parseFrontmatterMarkdown(readFileSync32(filepath, "utf8"));
955018
- const name2 = parsed.frontmatter.name || basename6(file, ".md");
955365
+ const parsed = parseFrontmatterMarkdown(readFileSync33(filepath, "utf8"));
955366
+ const name2 = parsed.frontmatter.name || basename7(file, ".md");
955019
955367
  if (!name2)
955020
955368
  continue;
955021
955369
  commands[name2] = {
@@ -955049,21 +955397,21 @@ function unquote(value2) {
955049
955397
  const quote = value2[0];
955050
955398
  return quote && quote === value2[value2.length - 1] && (quote === '"' || quote === "'") ? value2.slice(1, -1) : value2;
955051
955399
  }
955052
- function firstExistingDirectory(paths) {
955053
- return paths.find((dir) => existsSync33(dir) && statSync6(dir).isDirectory());
955400
+ function firstExistingDirectory2(paths) {
955401
+ return paths.find((dir) => existsSync35(dir) && statSync7(dir).isDirectory());
955054
955402
  }
955055
955403
  function resolveAgent0BuiltInSkillsRootCandidates(baseDir) {
955056
- return [join34(baseDir, "capabilities", "skills"), join34(baseDir, "agent0-assets", "skills"), join34(baseDir, "skills")];
955404
+ return [join35(baseDir, "capabilities", "skills"), join35(baseDir, "agent0-assets", "skills"), join35(baseDir, "skills")];
955057
955405
  }
955058
955406
  function resolveAgent0BuiltInCommandsRootCandidates(baseDir) {
955059
955407
  return [
955060
- join34(baseDir, "capabilities", "commands"),
955061
- join34(baseDir, "agent0-assets", "playbooks"),
955062
- join34(baseDir, "commands")
955408
+ join35(baseDir, "capabilities", "commands"),
955409
+ join35(baseDir, "agent0-assets", "playbooks"),
955410
+ join35(baseDir, "commands")
955063
955411
  ];
955064
955412
  }
955065
- function moduleDir() {
955066
- return dirname13(fileURLToPath17(import.meta.url));
955413
+ function moduleDir2() {
955414
+ return dirname14(fileURLToPath18(import.meta.url));
955067
955415
  }
955068
955416
  function getAgent0HomeDir(options = {}) {
955069
955417
  return join210(options.homeDir ?? process.env.HOME ?? homedir11(), ".adk", "agent0");
@@ -955742,30 +956090,18 @@ function countModelsByProvider(models2) {
955742
956090
  }
955743
956091
  return counts;
955744
956092
  }
955745
- function buildAgent0OpenCodePermissionConfig(options = {}) {
955746
- return {
955747
- ...Object.fromEntries(Object.entries(AGENT0_OPEN_CODE_PERMISSION_POLICY).map(([key, value2]) => [
955748
- key,
955749
- typeof value2 === "string" ? value2 : { ...value2 }
955750
- ])),
955751
- external_directory: buildAgent0ExternalDirectoryPermission(options.externalSkillPaths ?? [])
955752
- };
955753
- }
955754
- function buildAgent0ExternalDirectoryPermission(skillPaths) {
955755
- return Object.fromEntries([
955756
- ["*", "deny"],
955757
- ...skillPaths.map(toRecursivePathPattern).toSorted().map((pattern) => [pattern, "allow"])
955758
- ]);
955759
- }
955760
- function toRecursivePathPattern(path54) {
955761
- return `${path54.replace(/[\\/]+$/, "")}/**`;
956093
+ function buildAgent0OpenCodePermissionConfig() {
956094
+ return Object.fromEntries(Object.entries(AGENT0_OPEN_CODE_PERMISSION_POLICY).map(([key, value2]) => [
956095
+ key,
956096
+ typeof value2 === "string" ? value2 : { ...value2 }
956097
+ ]));
955762
956098
  }
955763
956099
  function getAgent0ProjectDiscoveryGitShimFilename(targetPlatform = platform5()) {
955764
956100
  return targetPlatform === "win32" ? "git.cmd" : "git";
955765
956101
  }
955766
956102
  async function ensureAgent0ProjectDiscoveryGitShim(paths2) {
955767
956103
  const targetPlatform = platform5();
955768
- const shimPath = join35(paths2.engineBinDir, getAgent0ProjectDiscoveryGitShimFilename(targetPlatform));
956104
+ const shimPath = join36(paths2.engineBinDir, getAgent0ProjectDiscoveryGitShimFilename(targetPlatform));
955769
956105
  const shimContent = targetPlatform === "win32" ? WINDOWS_GIT_SHIM : POSIX_GIT_SHIM;
955770
956106
  await mkdir22(paths2.engineBinDir, { recursive: true, mode: GIT_SHIM_MODE });
955771
956107
  await chmod3(paths2.engineBinDir, GIT_SHIM_MODE);
@@ -955804,7 +956140,7 @@ function buildAgent0OpenCodeConfig(options) {
955804
956140
  ...options.agent0Config || options.cognitiveModels !== undefined ? { enabled_providers: enabledProviders } : {},
955805
956141
  ...Object.keys(provider5).length ? { provider: provider5 } : {},
955806
956142
  mcp: builtIns.mcp,
955807
- permission: buildAgent0OpenCodePermissionConfig({ externalSkillPaths: builtIns.skills.paths }),
956143
+ permission: buildAgent0OpenCodePermissionConfig(),
955808
956144
  default_agent: builtIns.defaultAgent,
955809
956145
  agent: builtIns.agent,
955810
956146
  ...Object.keys(builtIns.command).length ? { command: builtIns.command } : {},
@@ -955948,8 +956284,8 @@ async function downloadAgent0OpenCodeBinary(options) {
955948
956284
  const cacheDir = getAgent0OpenCodeCacheDir(options);
955949
956285
  const tmpDirPath = join42(tmpdir2(), `agent0-opencode-download-${Date.now()}`);
955950
956286
  options.onLog?.(`Downloading opencode v${version4} (${name2})...`);
955951
- mkdirSync11(cacheDir, { recursive: true });
955952
- mkdirSync11(tmpDirPath, { recursive: true });
956287
+ mkdirSync12(cacheDir, { recursive: true });
956288
+ mkdirSync12(tmpDirPath, { recursive: true });
955953
956289
  try {
955954
956290
  const tarPath = join42(tmpDirPath, "opencode.tgz");
955955
956291
  const response = await fetchImpl(tarballUrl);
@@ -955958,7 +956294,7 @@ async function downloadAgent0OpenCodeBinary(options) {
955958
956294
  }
955959
956295
  await pipeline(response.body, createWriteStream4(tarPath));
955960
956296
  const extractDir = join42(tmpDirPath, "extracted");
955961
- mkdirSync11(extractDir, { recursive: true });
956297
+ mkdirSync12(extractDir, { recursive: true });
955962
956298
  execFileSync3("tar", ["xzf", tarPath, "-C", extractDir, `package/bin/${binary}`]);
955963
956299
  const extractedBinary = join42(extractDir, "package", "bin", binary);
955964
956300
  if (!existsSync34(extractedBinary)) {
@@ -955966,7 +956302,7 @@ async function downloadAgent0OpenCodeBinary(options) {
955966
956302
  }
955967
956303
  const destBinary = join42(cacheDir, binary);
955968
956304
  const tmpBinary = `${destBinary}.tmp`;
955969
- copyFileSync2(extractedBinary, tmpBinary);
956305
+ copyFileSync3(extractedBinary, tmpBinary);
955970
956306
  if (platform23() !== "win32")
955971
956307
  chmodSync2(tmpBinary, 493);
955972
956308
  renameSync3(tmpBinary, destBinary);
@@ -955974,7 +956310,7 @@ async function downloadAgent0OpenCodeBinary(options) {
955974
956310
  return destBinary;
955975
956311
  } finally {
955976
956312
  try {
955977
- rmSync(tmpDirPath, { recursive: true, force: true });
956313
+ rmSync2(tmpDirPath, { recursive: true, force: true });
955978
956314
  } catch {}
955979
956315
  }
955980
956316
  }
@@ -956251,12 +956587,12 @@ function createAgent0RuntimeClient(options) {
956251
956587
  },
956252
956588
  async listCommands() {
956253
956589
  return {
956254
- commands: listAgent0BuiltInCommands(),
956590
+ commands: listAgent0BuiltInCommands(options.projectPath),
956255
956591
  warnings: []
956256
956592
  };
956257
956593
  },
956258
956594
  async runCommand(sessionId, input) {
956259
- const command = getAgent0BuiltInCommand(input.command);
956595
+ const command = getAgent0BuiltInCommand(options.projectPath, input.command);
956260
956596
  if (!command) {
956261
956597
  throw new Agent0RuntimeClientError("ENGINE_INVALID_RESPONSE", `Unknown Agent(0) command: ${input.command}`);
956262
956598
  }
@@ -956610,16 +956946,22 @@ function normalizeQuestionAnswers(value2) {
956610
956946
  return [...answer2];
956611
956947
  });
956612
956948
  }
956613
- function listAgent0BuiltInCommands() {
956614
- return Object.entries(loadAgent0BuiltInCommandConfig()).map(([name2, command]) => ({
956949
+ function listAgent0BuiltInCommands(projectPath) {
956950
+ const commandsRoot = resolveAgent0ProjectPlaybooksRoot(projectPath);
956951
+ if (!commandsRoot)
956952
+ return [];
956953
+ return Object.entries(loadAgent0BuiltInCommandConfig(commandsRoot)).map(([name2, command]) => ({
956615
956954
  name: name2,
956616
956955
  ...command.description ? { description: command.description } : {},
956617
956956
  hints: extractAgent0CommandHints(command.template),
956618
956957
  ...typeof command.subtask === "boolean" ? { subtask: command.subtask } : {}
956619
956958
  })).toSorted((left, right) => left.name.localeCompare(right.name));
956620
956959
  }
956621
- function getAgent0BuiltInCommand(name2) {
956622
- return loadAgent0BuiltInCommandConfig()[name2];
956960
+ function getAgent0BuiltInCommand(projectPath, name2) {
956961
+ const commandsRoot = resolveAgent0ProjectPlaybooksRoot(projectPath);
956962
+ if (!commandsRoot)
956963
+ return;
956964
+ return loadAgent0BuiltInCommandConfig(commandsRoot)[name2];
956623
956965
  }
956624
956966
  function extractAgent0CommandHints(template2) {
956625
956967
  const hints = new Set;
@@ -957475,7 +957817,7 @@ When building a triage, routing, classification, extraction, or Q&A agent, the r
957475
957817
 
957476
957818
  ## ADK Knowledge Sources
957477
957819
 
957478
- 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/\`:
957820
+ 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/\`:
957479
957821
  - \`agent-config.md\` before changing \`agent.config.ts\`
957480
957822
  - \`conversations.md\` before writing or modifying conversations
957481
957823
  - \`triggers.md\` before event-driven behavior
@@ -957495,7 +957837,7 @@ Use ADK imports from \`@botpress/runtime\` for generated agent code. Use Botpres
957495
957837
 
957496
957838
  ## Command Playbooks
957497
957839
 
957498
- Generated projects include OpenCode command playbooks in \`.opencode/commands/\`. Use them as workflow guidance:
957840
+ Agent(0) command playbooks are available in \`.agent0/capabilities/playbooks/\`. Use them as workflow guidance:
957499
957841
  - \`adk-build.md\` for decomposing a feature into primitives and building it
957500
957842
  - \`adk-validate.md\` for static validation of a primitive or feature
957501
957843
  - \`adk-test.md\` for invoking the built behavior
@@ -957544,7 +957886,7 @@ Do not run commands that start, restart, or watch a development server from insi
957544
957886
 
957545
957887
  ## Communication Style
957546
957888
 
957547
- Warm, direct, and efficient. No filler. Bias to action over questions; when you must ask, one short batch at a time.`, AGENT0_DEFAULT_AGENT = "default", AGENT0_PRIMARY_AGENT_STEPS = 64, AGENT0_SCREENSHOT_MCP_TOOL_PERMISSION = "adk_adk_take_screenshot", AGENT0_SCREENSHOT_RAW_TOOL_PERMISSION = "adk_take_screenshot", PROJECT_HASH_LENGTH = 32, OWNER_ONLY_DIR_MODE = 448, agent0ProviderAuthSchema, agent0ProviderConnectionSchema, agent0ConfigPreferencesSchema, agent0ConfigSchema, DEFAULT_AGENT0_PREFERENCES, Agent0ConfigError, apiKey = (apiKeyLabel = "API key", baseURL) => ({
957889
+ Warm, direct, and efficient. No filler. Bias to action over questions; when you must ask, one short batch at a time.`, AGENT0_DEFAULT_AGENT = "default", AGENT0_PRIMARY_AGENT_STEPS = 64, AGENT0_PROJECT_DIR2 = ".agent0", AGENT0_PROJECT_CAPABILITIES_DIR2 = "capabilities", AGENT0_PROJECT_SKILLS_DIR2 = "skills", AGENT0_PROJECT_PLAYBOOKS_DIR2 = "playbooks", AGENT0_SCREENSHOT_MCP_TOOL_PERMISSION = "adk_adk_take_screenshot", AGENT0_SCREENSHOT_RAW_TOOL_PERMISSION = "adk_take_screenshot", PROJECT_HASH_LENGTH = 32, OWNER_ONLY_DIR_MODE = 448, agent0ProviderAuthSchema, agent0ProviderConnectionSchema, agent0ConfigPreferencesSchema, agent0ConfigSchema, DEFAULT_AGENT0_PREFERENCES, Agent0ConfigError, apiKey = (apiKeyLabel = "API key", baseURL) => ({
957548
957890
  type: "api_key",
957549
957891
  apiKeyLabel,
957550
957892
  ...baseURL ? {
@@ -957916,6 +958258,7 @@ var init_agent0 = __esm(() => {
957916
958258
  [AGENT0_HIDDEN_OPENCODE_SKILL]: "deny"
957917
958259
  },
957918
958260
  lsp: "allow",
958261
+ external_directory: "deny",
957919
958262
  repo_clone: "deny",
957920
958263
  repo_overview: "allow",
957921
958264
  [AGENT0_BUILT_IN_MCP_PERMISSION]: "allow"
@@ -967268,8 +967611,8 @@ var require_resolve = __commonJS((exports8) => {
967268
967611
  }
967269
967612
  return count2;
967270
967613
  }
967271
- function getFullPath(resolver, id4 = "", normalize9) {
967272
- if (normalize9 !== false)
967614
+ function getFullPath(resolver, id4 = "", normalize10) {
967615
+ if (normalize10 !== false)
967273
967616
  id4 = normalizeId(id4);
967274
967617
  const p4 = resolver.parse(id4);
967275
967618
  return _getFullPath(resolver, p4);
@@ -968556,7 +968899,7 @@ var require_schemes = __commonJS((exports8, module) => {
968556
968899
  var require_fast_uri = __commonJS((exports8, module) => {
968557
968900
  var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils14();
968558
968901
  var { SCHEMES, getSchemeHandler } = require_schemes();
968559
- function normalize9(uri, options) {
968902
+ function normalize10(uri, options) {
968560
968903
  if (typeof uri === "string") {
968561
968904
  uri = serialize2(parse15(uri, options), options);
968562
968905
  } else if (typeof uri === "object") {
@@ -968791,7 +969134,7 @@ var require_fast_uri = __commonJS((exports8, module) => {
968791
969134
  }
968792
969135
  var fastUri = {
968793
969136
  SCHEMES,
968794
- normalize: normalize9,
969137
+ normalize: normalize10,
968795
969138
  resolve: resolve26,
968796
969139
  resolveComponent,
968797
969140
  equal,
@@ -974110,8 +974453,8 @@ var init_main3 = __esm(() => {
974110
974453
  });
974111
974454
 
974112
974455
  // src/utils/debugger.ts
974113
- import { existsSync as existsSync35, mkdirSync as mkdirSync12, readFileSync as readFileSync33, writeFileSync as writeFileSync12 } from "fs";
974114
- import { join as join36 } from "path";
974456
+ import { existsSync as existsSync36, mkdirSync as mkdirSync13, readFileSync as readFileSync34, writeFileSync as writeFileSync13 } from "fs";
974457
+ import { join as join37 } from "path";
974115
974458
  async function startDebugger(options) {
974116
974459
  const { botPort, onActivity } = options;
974117
974460
  try {
@@ -974138,8 +974481,8 @@ async function startDebugger(options) {
974138
974481
  }
974139
974482
  }
974140
974483
  function writeVSCodeLaunchConfig(agentRoot, pid3) {
974141
- const vscodeDir = join36(agentRoot, ".vscode");
974142
- const launchPath = join36(vscodeDir, "launch.json");
974484
+ const vscodeDir = join37(agentRoot, ".vscode");
974485
+ const launchPath = join37(vscodeDir, "launch.json");
974143
974486
  const adkConfig = {
974144
974487
  type: "node",
974145
974488
  request: "attach",
@@ -974148,9 +974491,9 @@ function writeVSCodeLaunchConfig(agentRoot, pid3) {
974148
974491
  skipFiles: ["<node_internals>/**"]
974149
974492
  };
974150
974493
  let launchJson;
974151
- if (existsSync35(launchPath)) {
974494
+ if (existsSync36(launchPath)) {
974152
974495
  let parsed = null;
974153
- const raw = readFileSync33(launchPath, "utf-8");
974496
+ const raw = readFileSync34(launchPath, "utf-8");
974154
974497
  const parseErrors = [];
974155
974498
  parsed = parse16(raw, parseErrors, {
974156
974499
  allowTrailingComma: true,
@@ -974174,13 +974517,13 @@ function writeVSCodeLaunchConfig(agentRoot, pid3) {
974174
974517
  }
974175
974518
  launchJson = parsed;
974176
974519
  } else {
974177
- mkdirSync12(vscodeDir, { recursive: true });
974520
+ mkdirSync13(vscodeDir, { recursive: true });
974178
974521
  launchJson = {
974179
974522
  version: "0.2.0",
974180
974523
  configurations: [adkConfig]
974181
974524
  };
974182
974525
  }
974183
- writeFileSync12(launchPath, JSON.stringify(launchJson, null, 2) + `
974526
+ writeFileSync13(launchPath, JSON.stringify(launchJson, null, 2) + `
974184
974527
  `);
974185
974528
  return launchPath;
974186
974529
  }
@@ -974595,7 +974938,7 @@ var exports_adk_dev = {};
974595
974938
  __export(exports_adk_dev, {
974596
974939
  adkDev: () => adkDev
974597
974940
  });
974598
- import { createWriteStream as createWriteStream5, mkdirSync as mkdirSync13 } from "fs";
974941
+ import { createWriteStream as createWriteStream5, mkdirSync as mkdirSync14 } from "fs";
974599
974942
  import path66 from "path";
974600
974943
  function createDevLogFilePath(agentRoot) {
974601
974944
  const now3 = new Date;
@@ -974603,7 +974946,7 @@ function createDevLogFilePath(agentRoot) {
974603
974946
  const timeStr = now3.toTimeString().split(" ")[0].replace(/:/g, "-");
974604
974947
  const logFileName = `adk-dev-${dateStr}-${timeStr}.log`;
974605
974948
  const logsDir = path66.join(agentRoot, ".adk", "logs");
974606
- mkdirSync13(logsDir, { recursive: true });
974949
+ mkdirSync14(logsDir, { recursive: true });
974607
974950
  return path66.join(logsDir, logFileName);
974608
974951
  }
974609
974952
  async function collectConfigValidationSummary(agentProject, botId, credentials) {
@@ -975571,7 +975914,7 @@ var import_react42, jsx_dev_runtime24, logger7, AdkDevProcess = ({
975571
975914
  const setupLogging = () => {
975572
975915
  const agentRoot = debuggerRef.current.agentRoot;
975573
975916
  const logsDir = path66.join(agentRoot, ".adk", "logs");
975574
- mkdirSync13(logsDir, { recursive: true });
975917
+ mkdirSync14(logsDir, { recursive: true });
975575
975918
  const logStream = createWriteStream5(logFilePath, { flags: "a" });
975576
975919
  return logStream;
975577
975920
  };
@@ -981202,7 +981545,7 @@ var require_utils15 = __commonJS((exports8, module) => {
981202
981545
  module.exports = Utils;
981203
981546
  Utils.prototype.makeDir = function(folder) {
981204
981547
  const self2 = this;
981205
- function mkdirSync14(fpath) {
981548
+ function mkdirSync15(fpath) {
981206
981549
  let resolvedPath = fpath.split(self2.sep)[0];
981207
981550
  fpath.split(self2.sep).forEach(function(name2) {
981208
981551
  if (!name2 || name2.substr(-1, 1) === ":")
@@ -981222,7 +981565,7 @@ var require_utils15 = __commonJS((exports8, module) => {
981222
981565
  throw Errors5.FILE_IN_THE_WAY(`"${resolvedPath}"`);
981223
981566
  });
981224
981567
  }
981225
- mkdirSync14(folder);
981568
+ mkdirSync15(folder);
981226
981569
  };
981227
981570
  Utils.prototype.writeFileTo = function(path54, content, overwrite, attr) {
981228
981571
  const self2 = this;
@@ -982782,8 +983125,8 @@ var require_adm_zip = __commonJS((exports8, module) => {
982782
983125
  return null;
982783
983126
  }
982784
983127
  function fixPath(zipPath) {
982785
- const { join: join37, normalize: normalize9, sep: sep12 } = pth.posix;
982786
- return join37(pth.isAbsolute(zipPath) ? "/" : ".", normalize9(sep12 + zipPath.split("\\").join(sep12) + sep12));
983128
+ const { join: join38, normalize: normalize10, sep: sep13 } = pth.posix;
983129
+ return join38(pth.isAbsolute(zipPath) ? "/" : ".", normalize10(sep13 + zipPath.split("\\").join(sep13) + sep13));
982787
983130
  }
982788
983131
  function filenameFilter(filterfn) {
982789
983132
  if (filterfn instanceof RegExp) {
@@ -983308,18 +983651,18 @@ __export(exports_upgrade3, {
983308
983651
  adkSelfUpgrade: () => adkSelfUpgrade
983309
983652
  });
983310
983653
  import {
983311
- existsSync as existsSync36,
983312
- writeFileSync as writeFileSync13,
983654
+ existsSync as existsSync37,
983655
+ writeFileSync as writeFileSync14,
983313
983656
  chmodSync as chmodSync3,
983314
983657
  renameSync as renameSync4,
983315
983658
  unlinkSync as unlinkSync4,
983316
- readFileSync as readFileSync34,
983317
- mkdirSync as mkdirSync14,
983659
+ readFileSync as readFileSync35,
983660
+ mkdirSync as mkdirSync15,
983318
983661
  rmdirSync,
983319
983662
  accessSync as accessSync2,
983320
983663
  constants as constants7
983321
983664
  } from "fs";
983322
- import { join as join38, dirname as dirname14, basename as basename7 } from "path";
983665
+ import { join as join39, dirname as dirname15, basename as basename8 } from "path";
983323
983666
  import { tmpdir as tmpdir3 } from "os";
983324
983667
  import { execSync as execSync5, spawnSync as spawnSync2 } from "child_process";
983325
983668
  function getPlatformInfo() {
@@ -983381,17 +983724,17 @@ async function downloadBinary(version5, target, extension, logger8) {
983381
983724
  throw new Error(`Failed to download: ${response.status} ${response.statusText}`);
983382
983725
  }
983383
983726
  const buffer = Buffer.from(await response.arrayBuffer());
983384
- const tmpDir = join38(tmpdir3(), `adk-upgrade-${Date.now()}`);
983385
- mkdirSync14(tmpDir, { recursive: true });
983386
- const tarPath = join38(tmpDir, "adk.tar.gz");
983387
- writeFileSync13(tarPath, buffer);
983727
+ const tmpDir = join39(tmpdir3(), `adk-upgrade-${Date.now()}`);
983728
+ mkdirSync15(tmpDir, { recursive: true });
983729
+ const tarPath = join39(tmpDir, "adk.tar.gz");
983730
+ writeFileSync14(tarPath, buffer);
983388
983731
  co5({
983389
983732
  file: tarPath,
983390
983733
  cwd: tmpDir,
983391
983734
  sync: true
983392
983735
  });
983393
- const binaryPath = join38(tmpDir, fileName);
983394
- const binaryBuffer = readFileSync34(binaryPath);
983736
+ const binaryPath = join39(tmpDir, fileName);
983737
+ const binaryBuffer = readFileSync35(binaryPath);
983395
983738
  try {
983396
983739
  unlinkSync4(tarPath);
983397
983740
  unlinkSync4(binaryPath);
@@ -983419,7 +983762,7 @@ async function downloadBinaryWindows(version5, target, extension, logger8) {
983419
983762
  return binaryEntry.getData();
983420
983763
  }
983421
983764
  function isRuntimeOrPackageManagerExecutable(path54) {
983422
- return RUNTIME_BASENAMES.has(basename7(path54).toLowerCase());
983765
+ return RUNTIME_BASENAMES.has(basename8(path54).toLowerCase());
983423
983766
  }
983424
983767
  function isInPackageManagerDirectory(path54) {
983425
983768
  const normalized = path54.replace(/\\/g, "/");
@@ -983427,7 +983770,7 @@ function isInPackageManagerDirectory(path54) {
983427
983770
  }
983428
983771
  function isLaunchedAsScript() {
983429
983772
  const script = process.argv[1];
983430
- return !!script && script !== process.execPath && /\.(c|m)?js$/i.test(script) && existsSync36(script);
983773
+ return !!script && script !== process.execPath && /\.(c|m)?js$/i.test(script) && existsSync37(script);
983431
983774
  }
983432
983775
  function getCurrentBinaryPath() {
983433
983776
  const execPath3 = process.execPath;
@@ -983444,9 +983787,9 @@ function getCurrentBinaryPath() {
983444
983787
  }
983445
983788
  function checkWritePermissions(path54) {
983446
983789
  try {
983447
- const dir = dirname14(path54);
983790
+ const dir = dirname15(path54);
983448
983791
  accessSync2(dir, constants7.W_OK);
983449
- if (existsSync36(path54)) {
983792
+ if (existsSync37(path54)) {
983450
983793
  accessSync2(path54, constants7.W_OK);
983451
983794
  }
983452
983795
  return true;
@@ -983475,9 +983818,9 @@ ping /n 2 127.0.0.1 > NUL
983475
983818
  move /y "${currentPath}.new" "${currentPath}"
983476
983819
  del "%~f0"
983477
983820
  `.trim();
983478
- const batchPath = join38(tmpdir3(), "adk-upgrade.bat");
983479
- writeFileSync13(batchPath, batchScript);
983480
- writeFileSync13(currentPath + ".new", newBinaryBuffer);
983821
+ const batchPath = join39(tmpdir3(), "adk-upgrade.bat");
983822
+ writeFileSync14(batchPath, batchScript);
983823
+ writeFileSync14(currentPath + ".new", newBinaryBuffer);
983481
983824
  logger8.info("Update downloaded!", "green");
983482
983825
  logger8.info(" Restart your terminal to use the new version.");
983483
983826
  execSync5(`start "" /b "${batchPath}"`, { shell: "cmd.exe", windowsHide: true });
@@ -983485,12 +983828,12 @@ del "%~f0"
983485
983828
  const backupPath = currentPath + ".backup";
983486
983829
  try {
983487
983830
  renameSync4(currentPath, backupPath);
983488
- writeFileSync13(currentPath, newBinaryBuffer);
983831
+ writeFileSync14(currentPath, newBinaryBuffer);
983489
983832
  chmodSync3(currentPath, 493);
983490
983833
  unlinkSync4(backupPath);
983491
983834
  logger8.info("Successfully upgraded!", "green");
983492
983835
  } catch (error2) {
983493
- if (existsSync36(backupPath)) {
983836
+ if (existsSync37(backupPath)) {
983494
983837
  try {
983495
983838
  renameSync4(backupPath, currentPath);
983496
983839
  } catch {}
@@ -983596,109 +983939,159 @@ var init_upgrade3 = __esm(() => {
983596
983939
  // src/commands/adk-ai-upgrade.ts
983597
983940
  var exports_adk_ai_upgrade = {};
983598
983941
  __export(exports_adk_ai_upgrade, {
983599
- adkUpdate: () => adkUpdate
983942
+ adkUpdate: () => adkUpdate,
983943
+ adkAgent0Upgrade: () => adkAgent0Upgrade
983600
983944
  });
983601
- import { exec as exec5 } from "child_process";
983602
- import { promisify as promisify11 } from "util";
983603
- function getSkillsRunner(projectPath) {
983604
- const managers = detectPackageManagers();
983605
- const preferred = getPreferredPackageManager(projectPath, managers);
983606
- return preferred?.command === "bun" ? "bunx" : "npx";
983607
- }
983608
- async function adkUpdate(options = {}) {
983945
+ async function adkAgent0Upgrade(options = {}) {
983609
983946
  const isJson = options.format === "json";
983610
983947
  const logger8 = createCliLogger({ format: options.format });
983611
- const writeStdout = (text2) => logger8.stdout(text2);
983612
- const clearSpinner = (spinner, msgLength) => {
983613
- if (spinner) {
983614
- clearInterval(spinner);
983615
- writeStdout("\r" + " ".repeat(msgLength + 6) + "\r");
983616
- }
983617
- };
983618
983948
  const projectPath = await findAgentRootOrFail(process.cwd());
983619
- const result2 = {
983949
+ const status = checkAgent0CapabilitiesStatus(projectPath);
983950
+ const baseResult = {
983620
983951
  success: true,
983621
- skills: { success: true },
983622
- commands: { attempted: false, success: false, installedCommands: 0, failed: 0 }
983952
+ projectPath,
983953
+ command: "adk agent0 upgrade",
983954
+ currentVersion: status.currentVersion,
983955
+ previousVersion: status.state === "missing" ? undefined : status.installedVersion,
983956
+ updated: false
983623
983957
  };
983958
+ if (status.state === "current") {
983959
+ const manifest = readAgent0CapabilitiesManifest(projectPath);
983960
+ const result2 = {
983961
+ ...baseResult,
983962
+ capabilities: manifest ? {
983963
+ root: manifest.capabilitiesRoot,
983964
+ manifestPath: status.manifestPath,
983965
+ skills: manifest.skills.length,
983966
+ playbooks: manifest.playbooks.length
983967
+ } : undefined
983968
+ };
983969
+ if (isJson) {
983970
+ logger8.info("").result(result2);
983971
+ } else {
983972
+ logger8.info(`Agent(0) capabilities are already current (${status.currentVersion}).`, "green");
983973
+ }
983974
+ return;
983975
+ }
983624
983976
  if (!isJson) {
983625
- logger8.info("Updating ADK skills & commands...");
983977
+ logger8.info("Updating Agent(0) project capabilities...");
983626
983978
  logger8.newline();
983627
983979
  }
983628
983980
  let frameIdx = 0;
983629
- const skillsRunner = getSkillsRunner(projectPath);
983630
- const skillsCommand = `${skillsRunner} skills add ${getSkillsRepoRef()} -s '*' -a codex claude-code -y`;
983631
- const skillsMsg = "Updating ADK skills...";
983632
- const skillsSpinner = isJson ? null : setInterval(() => {
983633
- writeStdout(`\r ${SPINNER_FRAMES[frameIdx++ % SPINNER_FRAMES.length]} ${skillsMsg}`);
983981
+ const message = "Writing .agent0/capabilities...";
983982
+ const spinner = isJson ? null : setInterval(() => {
983983
+ logger8.stdout(`\r ${SPINNER_FRAMES[frameIdx++ % SPINNER_FRAMES.length]} ${message}`);
983634
983984
  }, 80);
983985
+ const clearSpinner = () => {
983986
+ if (!spinner)
983987
+ return;
983988
+ clearInterval(spinner);
983989
+ logger8.stdout("\r" + " ".repeat(message.length + 6) + "\r");
983990
+ };
983635
983991
  try {
983636
- await execAsync2(skillsCommand, {
983637
- cwd: projectPath,
983638
- env: { ...process.env },
983639
- timeout: 120000
983640
- });
983641
- clearSpinner(skillsSpinner, skillsMsg.length);
983642
- if (!isJson) {
983643
- logger8.info(" ADK skills updated", "green");
983992
+ const installed = await installAgent0Capabilities(projectPath);
983993
+ clearSpinner();
983994
+ const result2 = {
983995
+ ...baseResult,
983996
+ updated: true,
983997
+ capabilities: {
983998
+ root: installed.capabilitiesRoot,
983999
+ manifestPath: installed.manifestPath,
984000
+ source: installed.source,
984001
+ skills: installed.skills.installed,
984002
+ playbooks: installed.playbooks.installed
984003
+ }
984004
+ };
984005
+ if (isJson) {
984006
+ logger8.info("").result(result2);
984007
+ } else {
984008
+ logger8.info(`Agent(0) capabilities updated (${installed.skills.installed} skills, ${installed.playbooks.installed} commands).`, "green");
983644
984009
  }
983645
984010
  } catch (error2) {
983646
- result2.skills.success = false;
983647
- const stderr3 = error2 instanceof Error && "stderr" in error2 && error2.stderr ? String(error2.stderr).trim() : undefined;
983648
- result2.skills.error = stderr3 || (error2 instanceof Error ? error2.message : String(error2));
983649
- clearSpinner(skillsSpinner, skillsMsg.length);
983650
- if (!isJson) {
983651
- logger8.warn(" Failed to update ADK skills. Run manually:");
983652
- logger8.info(` > ${skillsCommand}`, "cyan");
984011
+ clearSpinner();
984012
+ const errorMessage2 = error2 instanceof Error ? error2.message : String(error2);
984013
+ const result2 = {
984014
+ ...baseResult,
984015
+ success: false,
984016
+ error: errorMessage2
984017
+ };
984018
+ if (isJson) {
984019
+ logger8.info("").result(result2);
984020
+ return;
983653
984021
  }
984022
+ logger8.error(`Failed to update Agent(0) capabilities: ${errorMessage2}`);
983654
984023
  }
983655
- const commandsMsg = "Updating ADK commands...";
983656
- const commandsSpinner = isJson ? null : setInterval(() => {
983657
- writeStdout(`\r ${SPINNER_FRAMES[frameIdx++ % SPINNER_FRAMES.length]} ${commandsMsg}`);
984024
+ }
984025
+ async function adkUpdate(options = {}) {
984026
+ const isJson = options.format === "json";
984027
+ const logger8 = createCliLogger({ format: options.format });
984028
+ const projectPath = await findAgentRootOrFail(process.cwd());
984029
+ if (!isJson) {
984030
+ logger8.info("Updating ADK skills & commands...");
984031
+ logger8.newline();
984032
+ }
984033
+ let frameIdx = 0;
984034
+ const message = "Updating external coding-agent capabilities...";
984035
+ const spinner = isJson ? null : setInterval(() => {
984036
+ logger8.stdout(`\r ${SPINNER_FRAMES[frameIdx++ % SPINNER_FRAMES.length]} ${message}`);
983658
984037
  }, 80);
984038
+ const clearSpinner = () => {
984039
+ if (!spinner)
984040
+ return;
984041
+ clearInterval(spinner);
984042
+ logger8.stdout("\r" + " ".repeat(message.length + 6) + "\r");
984043
+ };
983659
984044
  try {
983660
- result2.commands = await installCommands(projectPath, ALL_TARGETS);
983661
- clearSpinner(commandsSpinner, commandsMsg.length);
983662
- if (!isJson) {
983663
- if (result2.commands.success) {
983664
- logger8.info(` ADK commands updated (${result2.commands.installedCommands} commands)`, "green");
983665
- } else {
983666
- logger8.warn(" Failed to update ADK commands.");
983667
- }
983668
- }
983669
- } catch (error2) {
983670
- result2.commands = {
983671
- attempted: true,
983672
- success: false,
983673
- installedCommands: 0,
983674
- failed: 0,
983675
- error: error2 instanceof Error ? error2.message : String(error2)
984045
+ const externalHarness = await installExternalHarnessCapabilities({ projectPath });
984046
+ clearSpinner();
984047
+ const result2 = {
984048
+ success: externalHarness.success,
984049
+ projectPath,
984050
+ skills: externalHarness.skills,
984051
+ commands: externalHarness.commands
983676
984052
  };
983677
- clearSpinner(commandsSpinner, commandsMsg.length);
983678
- if (!isJson) {
984053
+ if (isJson) {
984054
+ logger8.info("").result(result2);
984055
+ return;
984056
+ }
984057
+ if (externalHarness.skills.success) {
984058
+ logger8.info(" ADK skills updated", "green");
984059
+ } else {
984060
+ logger8.warn(" Failed to update ADK skills. Run manually:");
984061
+ logger8.info(` > ${externalHarness.skills.command}`, "cyan");
984062
+ }
984063
+ if (externalHarness.commands.success) {
984064
+ logger8.info(` ADK commands updated (${externalHarness.commands.installedCommands} commands)`, "green");
984065
+ } else {
983679
984066
  logger8.warn(" Failed to update ADK commands.");
983680
984067
  }
983681
- }
983682
- result2.success = result2.skills.success && result2.commands.success;
983683
- if (isJson) {
983684
- logger8.info("").result(result2);
983685
- } else {
983686
984068
  logger8.newline();
983687
- if (result2.success) {
984069
+ if (externalHarness.success) {
983688
984070
  logger8.info("All up to date!", "green");
983689
984071
  } else {
983690
984072
  logger8.warn("Some updates failed. See warnings above.");
983691
984073
  }
984074
+ } catch (error2) {
984075
+ clearSpinner();
984076
+ const message2 = error2 instanceof Error ? error2.message : String(error2);
984077
+ const result2 = {
984078
+ success: false,
984079
+ projectPath,
984080
+ error: message2
984081
+ };
984082
+ if (isJson) {
984083
+ logger8.info("").result(result2);
984084
+ return;
984085
+ }
984086
+ logger8.error(`Failed to update ADK skills & commands: ${message2}`);
983692
984087
  }
983693
984088
  }
983694
- var execAsync2, SPINNER_FRAMES;
983695
- var init_adk_ai_upgrade = __esm(() => {
983696
- init_fetch_commands();
983697
- init_package_manager();
983698
- init_skills_ref();
984089
+ var SPINNER_FRAMES;
984090
+ var init_adk_ai_upgrade = __esm(async () => {
984091
+ init_external_harness_capabilities();
983699
984092
  init_agent_root();
983700
984093
  init_logger();
983701
- execAsync2 = promisify11(exec5);
984094
+ await init_agent0_capabilities();
983702
984095
  SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
983703
984096
  });
983704
984097
 
@@ -984035,7 +984428,7 @@ var exports_adk_kill = {};
984035
984428
  __export(exports_adk_kill, {
984036
984429
  adkKill: () => adkKill
984037
984430
  });
984038
- import { existsSync as existsSync37, unlinkSync as unlinkSync5 } from "fs";
984431
+ import { existsSync as existsSync38, unlinkSync as unlinkSync5 } from "fs";
984039
984432
  import path68 from "path";
984040
984433
  function resolveAgentTarget(target, agents) {
984041
984434
  const normalizedTarget = target.toLowerCase();
@@ -984200,7 +984593,7 @@ function cleanupConsoleFiles() {
984200
984593
  [CONSOLE_SOCKET_PATH, "console.sock"],
984201
984594
  [CONSOLE_LOCK_FILE, "console.lock"]
984202
984595
  ]) {
984203
- if (existsSync37(filePath)) {
984596
+ if (existsSync38(filePath)) {
984204
984597
  try {
984205
984598
  unlinkSync5(filePath);
984206
984599
  removed.push(label2);
@@ -987131,7 +987524,7 @@ __export(exports_adk_run, {
987131
987524
  adkRun: () => adkRun
987132
987525
  });
987133
987526
  import path69 from "path";
987134
- import { existsSync as existsSync38 } from "fs";
987527
+ import { existsSync as existsSync39 } from "fs";
987135
987528
  async function adkRun(scriptPath, args = [], options = {}) {
987136
987529
  const logger9 = createCliLogger();
987137
987530
  const envLabel = options.prod ? "production" : "development";
@@ -987153,7 +987546,7 @@ async function adkRun(scriptPath, args = [], options = {}) {
987153
987546
  await assertValidProject(project);
987154
987547
  logger9.info(`\uD83D\uDCE6 Project: ${project.config?.name || "Unknown"}`, "green");
987155
987548
  const absoluteScriptPath = path69.isAbsolute(scriptPath) ? scriptPath : path69.resolve(process.cwd(), scriptPath);
987156
- if (!existsSync38(absoluteScriptPath)) {
987549
+ if (!existsSync39(absoluteScriptPath)) {
987157
987550
  throw new Error(`Script not found: ${absoluteScriptPath}`);
987158
987551
  }
987159
987552
  logger9.info(`\uD83D\uDCDC Script: ${path69.relative(process.cwd(), absoluteScriptPath)}`, "cyan");
@@ -990525,10 +990918,21 @@ program.command("self-upgrade").alias("self-update").description("Upgrade ADK CL
990525
990918
  logger10.fatal(error2);
990526
990919
  }
990527
990920
  });
990528
- program.command("ai-upgrade").description("Update ADK skills and slash commands from the botpress/skills repository").option("--format <format>", "output format (json)").action(async (options) => {
990921
+ var agent0Command = program.command("agent0").description("Manage Agent(0)");
990922
+ agent0Command.command("upgrade").description("Create or update the project Agent(0) capability bundle").option("--format <format>", "output format (json)").action(async (options) => {
990923
+ try {
990924
+ await trackCmd("agent0-upgrade", async () => {
990925
+ const { adkAgent0Upgrade: adkAgent0Upgrade2 } = await init_adk_ai_upgrade().then(() => exports_adk_ai_upgrade);
990926
+ await adkAgent0Upgrade2(options);
990927
+ }, false);
990928
+ } catch (error2) {
990929
+ createCliLogger({ format: options.format }).fatal(error2);
990930
+ }
990931
+ });
990932
+ program.command("ai-upgrade").description("Update ADK skills and slash commands for external coding agents").option("--format <format>", "output format (json)").action(async (options) => {
990529
990933
  try {
990530
990934
  await trackCmd("ai-upgrade", async () => {
990531
- const { adkUpdate: adkUpdate2 } = await Promise.resolve().then(() => (init_adk_ai_upgrade(), exports_adk_ai_upgrade));
990935
+ const { adkUpdate: adkUpdate2 } = await init_adk_ai_upgrade().then(() => exports_adk_ai_upgrade);
990532
990936
  await adkUpdate2(options);
990533
990937
  }, false);
990534
990938
  } catch (error2) {