@botpress/adk 1.8.2 → 1.8.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"interface-sync.d.ts","sourceRoot":"","sources":["../../src/bot-generator/interface-sync.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChD;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,aAAa,CAAQ;gBAEjB,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAMvD;;OAEG;YACW,eAAe;IAmB7B;;OAEG;YACW,iBAAiB;IA6B/B;;OAEG;YACW,gBAAgB;IAgE9B;;OAEG;YACW,qBAAqB;IAiBnC;;OAEG;YACW,qBAAqB;IAQnC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAuCrD"}
1
+ {"version":3,"file":"interface-sync.d.ts","sourceRoot":"","sources":["../../src/bot-generator/interface-sync.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,MAAM,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChD;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,aAAa,CAAQ;gBAEjB,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAMvD;;OAEG;YACW,eAAe;IAmB7B;;OAEG;YACW,iBAAiB;IA6B/B;;OAEG;YACW,gBAAgB;IAuC9B;;OAEG;YACW,qBAAqB;IAiBnC;;OAEG;YACW,qBAAqB;IAQnC;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;CAuCrD"}
@@ -1,6 +1,6 @@
1
1
  import { BaseCommand } from './base-command.js';
2
2
  export interface BpAddCommandOptions {
3
- integration: string;
3
+ resource: string;
4
4
  botPath: string;
5
5
  workspaceId: string;
6
6
  credentials: {
@@ -1 +1 @@
1
- {"version":3,"file":"bp-add-command.d.ts","sourceRoot":"","sources":["../../src/commands/bp-add-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,qBAAa,YAAa,SAAQ,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC;IAI5C,OAAO,CAAC,OAAO;IAH3B,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,MAAM,CAAQ;gBAEF,OAAO,EAAE,mBAAmB;IAI1C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA+D1B,IAAI,CAAC,MAAM,GAAE,MAAM,CAAC,OAAmB,GAAG,IAAI;CAM/C"}
1
+ {"version":3,"file":"bp-add-command.d.ts","sourceRoot":"","sources":["../../src/commands/bp-add-command.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,qBAAa,YAAa,SAAQ,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC;IAI5C,OAAO,CAAC,OAAO;IAH3B,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,MAAM,CAAQ;gBAEF,OAAO,EAAE,mBAAmB;IAI1C,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA+D1B,IAAI,CAAC,MAAM,GAAE,MAAM,CAAC,OAAmB,GAAG,IAAI;CAM/C"}
package/dist/index.js CHANGED
@@ -654,7 +654,7 @@ var PRETTIER_CONFIG, formatCode = async (code, filepath) => {
654
654
  `));
655
655
  return code;
656
656
  }
657
- }, ADK_VERSION = "1.8.2", relative2 = (from, to) => {
657
+ }, ADK_VERSION = "1.8.3", relative2 = (from, to) => {
658
658
  const fromDir = path10.dirname(from);
659
659
  const relative3 = path10.relative(fromDir, to);
660
660
  return relative3.startsWith(".") ? relative3 : `./${relative3}`;
@@ -797,7 +797,7 @@ var init_integration_action_types = __esm(() => {
797
797
  var require_package = __commonJS((exports, module) => {
798
798
  module.exports = {
799
799
  name: "@botpress/adk",
800
- version: "1.8.2",
800
+ version: "1.8.3",
801
801
  description: "Core ADK library for building AI agents on Botpress",
802
802
  type: "module",
803
803
  main: "dist/index.js",
@@ -841,10 +841,10 @@ var require_package = __commonJS((exports, module) => {
841
841
  url: "https://github.com/botpress/adk"
842
842
  },
843
843
  dependencies: {
844
- "@botpress/cli": "^4.23",
844
+ "@botpress/cli": "^4.27.3",
845
845
  "@botpress/client": "^1.27.2",
846
846
  "@botpress/cognitive": "^0.2.0",
847
- "@botpress/runtime": "^1.8.2",
847
+ "@botpress/runtime": "^1.8.3",
848
848
  "@botpress/sdk": "^4.18.1",
849
849
  "@bpinternal/yargs-extra": "^0.0.21",
850
850
  "@parcel/watcher": "^2.5.1",
@@ -1156,11 +1156,11 @@ class BpAddCommand extends BaseCommand {
1156
1156
  this.options = options;
1157
1157
  }
1158
1158
  async run() {
1159
- const { integration, botPath, workspaceId, credentials } = this.options;
1159
+ const { resource, botPath, workspaceId, credentials } = this.options;
1160
1160
  const { path: bpCommand } = await getBpCli(botPath);
1161
1161
  const args = [
1162
1162
  "add",
1163
- `integration:${integration}`,
1163
+ resource,
1164
1164
  "-y",
1165
1165
  "--installPath",
1166
1166
  botPath,
@@ -4829,7 +4829,7 @@ class AgentProjectGenerator {
4829
4829
  deploy: "adk deploy"
4830
4830
  },
4831
4831
  dependencies: {
4832
- "@botpress/runtime": `^${"1.8.2"}`
4832
+ "@botpress/runtime": `^${"1.8.3"}`
4833
4833
  },
4834
4834
  devDependencies: {
4835
4835
  typescript: "^5.9.3"
@@ -6071,7 +6071,7 @@ class IntegrationSync {
6071
6071
  throw new Error('No workspace ID found. Please login with "adk login"');
6072
6072
  }
6073
6073
  const command = new BpAddCommand({
6074
- integration: integration.fullVersion,
6074
+ resource: `integration:${integration.fullVersion}`,
6075
6075
  botPath: this.botProjectPath,
6076
6076
  workspaceId,
6077
6077
  credentials
@@ -6129,7 +6129,6 @@ class IntegrationSync {
6129
6129
  import path27 from "path";
6130
6130
  import fs14 from "fs/promises";
6131
6131
  import { existsSync as existsSync4 } from "fs";
6132
- import { spawn } from "child_process";
6133
6132
  init_constants();
6134
6133
  class InterfaceSync {
6135
6134
  projectPath;
@@ -6183,47 +6182,27 @@ class InterfaceSync {
6183
6182
  if (!workspaceId) {
6184
6183
  throw new Error('No workspace ID found. Please login with "adk login"');
6185
6184
  }
6186
- const bpCli = await getBpCli(this.projectPath);
6187
- const bpPath = bpCli.path;
6188
6185
  return new Promise((resolve3, reject) => {
6189
- const args = [
6190
- "add",
6191
- `interface:${interfaceInfo.fullVersion}`,
6192
- "-y",
6193
- "--installPath",
6194
- this.botProjectPath,
6195
- "--token",
6196
- credentials.token,
6197
- "--workspaceId",
6186
+ const command = new BpAddCommand({
6187
+ resource: `interface:${interfaceInfo.fullVersion}`,
6188
+ botPath: this.botProjectPath,
6198
6189
  workspaceId,
6199
- "--apiUrl",
6200
- credentials.apiUrl
6201
- ];
6202
- const isJsFile = bpPath.endsWith(".js");
6203
- const command = isJsFile ? "node" : bpPath;
6204
- const commandArgs = isJsFile ? [bpPath, ...args] : args;
6205
- const child = spawn(command, commandArgs, {
6206
- cwd: this.projectPath,
6207
- stdio: "pipe"
6190
+ credentials: {
6191
+ token: credentials.token,
6192
+ apiUrl: credentials.apiUrl
6193
+ }
6208
6194
  });
6209
- let stdout = "";
6210
6195
  let stderr = "";
6211
- child.stdout?.on("data", (data) => {
6212
- stdout += data.toString();
6213
- });
6214
- child.stderr?.on("data", (data) => {
6215
- stderr += data.toString();
6196
+ command.on("stderr", (data) => {
6197
+ stderr += data;
6216
6198
  });
6217
- child.on("close", (code) => {
6218
- if (code === 0) {
6219
- resolve3();
6220
- } else {
6221
- reject(new Error(`Failed to install interface ${interfaceInfo.fullVersion}: ${stderr || stdout}`));
6222
- }
6199
+ command.on("error", (error) => {
6200
+ reject(new Error(`Failed to install interface ${interfaceInfo.fullVersion}: ${error.stderr || error.message}`));
6223
6201
  });
6224
- child.on("error", (error) => {
6225
- reject(new Error(`Failed to spawn bp command: ${error.message}`));
6202
+ command.on("done", () => {
6203
+ resolve3();
6226
6204
  });
6205
+ command.run().catch(reject);
6227
6206
  });
6228
6207
  }
6229
6208
  async renameInterfaceFolder(interfaceInfo) {
@@ -9095,5 +9074,5 @@ export {
9095
9074
  AgentProject
9096
9075
  };
9097
9076
 
9098
- //# debugId=F4D6956C29E3511964756E2164756E21
9077
+ //# debugId=B1A0BC735B2769D464756E2164756E21
9099
9078
  //# sourceMappingURL=index.js.map