@botpress/adk 1.3.5 → 1.3.8

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":"agent-project-generator.d.ts","sourceRoot":"","sources":["../../src/agent-init/agent-project-generator.ts"],"names":[],"mappings":"AAKA,qBAAa,qBAAqB;IAChC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAS;gBAEnB,WAAW,EAAE,MAAM,EAAE,cAAc,GAAE,MAAc;IAMzD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAY/B,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,iBAAiB;IA4BzB,OAAO,CAAC,sBAAsB;YAQhB,iBAAiB;IAoB/B,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,eAAe;YAqCT,YAAY;YA8CZ,qBAAqB;IAkCnC,OAAO,CAAC,SAAS;YAKH,kBAAkB;IAQhC,OAAO,CAAC,aAAa;CAGtB"}
1
+ {"version":3,"file":"agent-project-generator.d.ts","sourceRoot":"","sources":["../../src/agent-init/agent-project-generator.ts"],"names":[],"mappings":"AAQA,qBAAa,qBAAqB;IAChC,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAS;gBAEnB,WAAW,EAAE,MAAM,EAAE,cAAc,GAAE,MAAc;IAMzD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAY/B,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,iBAAiB;IA4BzB,OAAO,CAAC,sBAAsB;YAQhB,iBAAiB;IAoB/B,OAAO,CAAC,cAAc;IA2BtB,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,eAAe;YAqCT,YAAY;YA8CZ,qBAAqB;IAkCnC,OAAO,CAAC,SAAS;YAKH,kBAAkB;IAQhC,OAAO,CAAC,aAAa;CAGtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"integration-types.d.ts","sourceRoot":"","sources":["../../src/generators/integration-types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAsB7D,QAAA,MAAM,mBAAmB,GAAI,aAAa,iBAAiB;;;;;;;;;;;;;;;CAezD,CAAC;AAEH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,iBAAiB,GAC7B,OAAO,CAAC;IACT,KAAK,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;IAC9C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC,CAuOD"}
1
+ {"version":3,"file":"integration-types.d.ts","sourceRoot":"","sources":["../../src/generators/integration-types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAsB7D,QAAA,MAAM,mBAAmB,GAAI,aAAa,iBAAiB;;;;;;;;;;;;;;;CAezD,CAAC;AAEH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,iBAAiB,GAC7B,OAAO,CAAC;IACT,KAAK,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC;IAC9C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC,CA0OD"}
package/dist/index.js CHANGED
@@ -2862,13 +2862,14 @@ class IntegrationOperations {
2862
2862
  }
2863
2863
  async getIntegrationVersions(name) {
2864
2864
  const client = await this.getClient();
2865
+ const ref = this.parseIntegrationRef(name);
2865
2866
  try {
2866
2867
  const latestResponse = await client.getIntegrationByName({
2867
- name,
2868
+ name: ref.fullName,
2868
2869
  version: "latest"
2869
2870
  });
2870
2871
  return {
2871
- name,
2872
+ name: ref.fullName,
2872
2873
  version: latestResponse.integration.version,
2873
2874
  latestVersion: latestResponse.integration.version,
2874
2875
  availableVersions: [latestResponse.integration.version]
@@ -2876,25 +2877,25 @@ class IntegrationOperations {
2876
2877
  } catch {
2877
2878
  try {
2878
2879
  const latestResponse = await client.getPublicIntegration({
2879
- name,
2880
+ name: ref.name,
2880
2881
  version: "latest"
2881
2882
  });
2882
2883
  return {
2883
- name,
2884
+ name: ref.fullName,
2884
2885
  version: latestResponse.integration.version,
2885
2886
  latestVersion: latestResponse.integration.version,
2886
2887
  availableVersions: [latestResponse.integration.version]
2887
2888
  };
2888
2889
  } catch {
2889
- throw new Error(`Integration "${name}" not found`);
2890
+ throw new Error(`Integration "${ref.fullName}" not found`);
2890
2891
  }
2891
2892
  }
2892
2893
  }
2893
2894
  async addIntegration(options) {
2894
2895
  const project = await AgentProject.load(this.projectPath || process2.cwd());
2895
2896
  const { name, version = "latest" } = options;
2896
- const alias = options.alias || name;
2897
2897
  const ref = this.parseIntegrationRef(`${name}@${version}`);
2898
+ const alias = options.alias || ref.name;
2898
2899
  const depsPath = path9.join(project.path, "dependencies.json");
2899
2900
  const dependencies = JSON.parse(fs8.readFileSync(depsPath, "utf-8"));
2900
2901
  if (!dependencies.integrations) {
@@ -3000,25 +3001,23 @@ class IntegrationOperations {
3000
3001
  }
3001
3002
  for (const [alias, value] of Object.entries(integrationsToUpgrade)) {
3002
3003
  try {
3003
- let integrationName;
3004
+ let ref;
3004
3005
  let currentVersion;
3005
3006
  if (typeof value === "string") {
3006
- const ref = this.parseIntegrationRef(value);
3007
- integrationName = ref.name;
3007
+ ref = this.parseIntegrationRef(value);
3008
3008
  currentVersion = ref.version;
3009
3009
  } else if (typeof value === "object" && value.version) {
3010
- const ref = this.parseIntegrationRef(value.version);
3011
- integrationName = ref.name;
3010
+ ref = this.parseIntegrationRef(value.version);
3012
3011
  currentVersion = ref.version;
3013
3012
  } else {
3014
3013
  failed.push(alias);
3015
3014
  continue;
3016
3015
  }
3017
- const versionInfo = await this.getIntegrationVersions(integrationName);
3016
+ const versionInfo = await this.getIntegrationVersions(ref.fullName);
3018
3017
  if (versionInfo.latestVersion && versionInfo.latestVersion !== currentVersion) {
3019
3018
  dependencies.integrations[alias] = {
3020
3019
  ...value,
3021
- version: `${integrationName}@${versionInfo.latestVersion}`
3020
+ version: `${ref.fullName}@${versionInfo.latestVersion}`
3022
3021
  };
3023
3022
  upgraded.push(`${alias} (${currentVersion} → ${versionInfo.latestVersion})`);
3024
3023
  }
@@ -3043,10 +3042,10 @@ class IntegrationOperations {
3043
3042
  for (const [alias, value] of Object.entries(dependencies.integrations)) {
3044
3043
  if (typeof value === "string") {
3045
3044
  const ref = this.parseIntegrationRef(value);
3046
- integrations.push({ alias, name: ref.name, version: ref.version });
3045
+ integrations.push({ alias, name: ref.fullName, version: ref.version });
3047
3046
  } else if (typeof value === "object" && value.version) {
3048
3047
  const ref = this.parseIntegrationRef(value.version);
3049
- integrations.push({ alias, name: ref.name, version: ref.version });
3048
+ integrations.push({ alias, name: ref.fullName, version: ref.version });
3050
3049
  }
3051
3050
  }
3052
3051
  return integrations;
@@ -3182,7 +3181,8 @@ class IntegrationChecker {
3182
3181
  }
3183
3182
  let installedIntegration = null;
3184
3183
  for (const [_key, installed] of Object.entries(installedIntegrations)) {
3185
- if (installed.name === ref.fullName) {
3184
+ const matches = installed.name === ref.fullName || installed.name === ref.name;
3185
+ if (matches) {
3186
3186
  installedIntegration = installed;
3187
3187
  processedIntegrationIds.add(installed.id);
3188
3188
  break;
@@ -4465,7 +4465,7 @@ class AgentProjectGenerator {
4465
4465
  deploy: "adk deploy"
4466
4466
  },
4467
4467
  dependencies: {
4468
- "@botpress/runtime": "^1.0.0"
4468
+ "@botpress/runtime": `^${"1.3.8"}`
4469
4469
  },
4470
4470
  devDependencies: {
4471
4471
  typescript: "^5.0.0"
@@ -4870,7 +4870,7 @@ Description: ${action.description || "No description"}`)}
4870
4870
  const comment = toMultilineComment(`Title: ${tag?.title}
4871
4871
  Description: ${tag.description}`);
4872
4872
  acc += `${comment}
4873
- ["${integration.definition.name}:${t}"]?: string,
4873
+ ["${integration.ref.fullName}:${t}"]?: string,
4874
4874
  `;
4875
4875
  return acc;
4876
4876
  }, "") + "}";
@@ -4879,7 +4879,7 @@ Description: ${tag.description}`);
4879
4879
  const comment = toMultilineComment(`Title: ${tag?.title}
4880
4880
  Description: ${tag.description}`);
4881
4881
  acc += `${comment}
4882
- ["${integration.definition.name}:${t}"]?: string,
4882
+ ["${integration.ref.fullName}:${t}"]?: string,
4883
4883
  `;
4884
4884
  return acc;
4885
4885
  }, "") + "}";
@@ -4954,7 +4954,7 @@ Description: ${event.description || "No description"}${attributesComment}`)}
4954
4954
  const comment = toMultilineComment(`Title: ${tag?.title}
4955
4955
  Description: ${tag?.description}`);
4956
4956
  return `${comment}
4957
- "${integration.definition?.name}:${t}"
4957
+ "${integration.ref.fullName}:${t}"
4958
4958
  `;
4959
4959
  }).join(" | ") : "never";
4960
4960
  tUsers += `
@@ -7277,5 +7277,5 @@ export {
7277
7277
  AgentProject
7278
7278
  };
7279
7279
 
7280
- //# debugId=058CF65E94A0582A64756E2164756E21
7280
+ //# debugId=89632232C9C87A3464756E2164756E21
7281
7281
  //# sourceMappingURL=index.js.map