@botpress/adk 1.18.0-beta.6 → 1.18.0
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":"generator.d.ts","sourceRoot":"","sources":["../../src/bot-generator/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/bot-generator/generator.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAoC1D,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,YAAY,CAAA;IACnD,SAAS,CAAC,EAAE,aAAa,CAAA;CAC1B;AAoBD,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,UAAU,CAAC,CAAwC;IAC3D,OAAO,CAAC,SAAS,CAAC,CAAe;gBAErB,OAAO,EAAE,mBAAmB;YAO1B,kBAAkB;YAuBlB,sBAAsB;IAsB9B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAqCjB,yBAAyB;YAkEzB,oBAAoB;YA8DpB,kBAAkB;YAKlB,oBAAoB;YAKpB,gBAAgB;YAKhB,kBAAkB;YAKlB,0BAA0B;YAK1B,mBAAmB;YAKnB,kBAAkB;YAKlB,qBAAqB;YAKrB,yBAAyB;YAKzB,sBAAsB;YAKtB,mBAAmB;YAMnB,8BAA8B;YAM9B,yBAAyB;YAKzB,qBAAqB;YAKrB,oBAAoB;YAyEpB,uBAAuB;YAgGvB,8BAA8B;YA4B9B,yBAAyB;YA0BzB,4BAA4B;IA2B1C;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;YAiDhB,qBAAqB;YAufrB,gBAAgB;YAyChB,mBAAmB;YAgBnB,gBAAgB;YAmChB,mBAAmB;YAyBnB,UAAU;YAWV,aAAa;IAgBrB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;YAwd3B,0BAA0B;IAgBlC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAOzC;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4DpF"}
|
package/dist/index.js
CHANGED
|
@@ -2148,7 +2148,7 @@ var _format = null, _formatLoaded = false, formatCode = async (code, filepath) =
|
|
|
2148
2148
|
`));
|
|
2149
2149
|
return code;
|
|
2150
2150
|
}
|
|
2151
|
-
}, ADK_VERSION = "1.18.0
|
|
2151
|
+
}, ADK_VERSION = "1.18.0", relative2 = (from, to) => {
|
|
2152
2152
|
const fromDir = path9.dirname(from);
|
|
2153
2153
|
const relative3 = path9.relative(fromDir, to);
|
|
2154
2154
|
return relative3.startsWith(".") ? relative3 : `./${relative3}`;
|
|
@@ -2875,6 +2875,7 @@ class IntegrationOperations {
|
|
|
2875
2875
|
}
|
|
2876
2876
|
const actualVersion = integrationDefinition.version;
|
|
2877
2877
|
const integrationVersion = `${resolvedInput.fullName}@${actualVersion}`;
|
|
2878
|
+
const requiresConfiguration = integrationRequiresConfiguration(integrationDefinition);
|
|
2878
2879
|
const existingEntry = dependencies.integrations[alias];
|
|
2879
2880
|
if (existingEntry && typeof existingEntry === "object" && "version" in existingEntry) {
|
|
2880
2881
|
dependencies.integrations[alias] = {
|
|
@@ -2893,7 +2894,8 @@ class IntegrationOperations {
|
|
|
2893
2894
|
fullName: resolvedInput.fullName,
|
|
2894
2895
|
alias: resolvedInput.alias,
|
|
2895
2896
|
version: actualVersion,
|
|
2896
|
-
ref: integrationVersion
|
|
2897
|
+
ref: integrationVersion,
|
|
2898
|
+
requiresConfiguration
|
|
2897
2899
|
};
|
|
2898
2900
|
}
|
|
2899
2901
|
async removeIntegration(name) {
|
|
@@ -2997,6 +2999,31 @@ class IntegrationOperations {
|
|
|
2997
2999
|
}));
|
|
2998
3000
|
}
|
|
2999
3001
|
}
|
|
3002
|
+
function integrationRequiresConfiguration(definition) {
|
|
3003
|
+
const config = definition.configuration;
|
|
3004
|
+
if (!config)
|
|
3005
|
+
return true;
|
|
3006
|
+
if (config.identifier?.required)
|
|
3007
|
+
return true;
|
|
3008
|
+
if (config.identifier?.linkTemplateScript)
|
|
3009
|
+
return true;
|
|
3010
|
+
const required = config.schema?.required;
|
|
3011
|
+
if (Array.isArray(required) && required.length > 0)
|
|
3012
|
+
return true;
|
|
3013
|
+
return false;
|
|
3014
|
+
}
|
|
3015
|
+
function resolveIntegrationEnabled(integration, cloudEnabled) {
|
|
3016
|
+
if (integration.enabled !== undefined) {
|
|
3017
|
+
return integration.enabled;
|
|
3018
|
+
}
|
|
3019
|
+
if (cloudEnabled !== undefined) {
|
|
3020
|
+
return cloudEnabled;
|
|
3021
|
+
}
|
|
3022
|
+
if (integration.definition && !integrationRequiresConfiguration(integration.definition)) {
|
|
3023
|
+
return true;
|
|
3024
|
+
}
|
|
3025
|
+
return false;
|
|
3026
|
+
}
|
|
3000
3027
|
var init_operations = __esm(() => {
|
|
3001
3028
|
init_auth();
|
|
3002
3029
|
init_agent_project();
|
|
@@ -4969,7 +4996,7 @@ var init_integration_action_types = __esm(() => {
|
|
|
4969
4996
|
var require_package = __commonJS((exports, module) => {
|
|
4970
4997
|
module.exports = {
|
|
4971
4998
|
name: "@botpress/adk",
|
|
4972
|
-
version: "1.18.0
|
|
4999
|
+
version: "1.18.0",
|
|
4973
5000
|
description: "Core ADK library for building AI agents on Botpress",
|
|
4974
5001
|
keywords: [
|
|
4975
5002
|
"adk",
|
|
@@ -5018,7 +5045,7 @@ var require_package = __commonJS((exports, module) => {
|
|
|
5018
5045
|
"@botpress/cli": "~6.3.2",
|
|
5019
5046
|
"@botpress/client": "~1.39.0",
|
|
5020
5047
|
"@botpress/cognitive": "~0.5.2",
|
|
5021
|
-
"@botpress/runtime": "^1.18.0
|
|
5048
|
+
"@botpress/runtime": "^1.18.0",
|
|
5022
5049
|
"@botpress/sdk": "~6.4.4",
|
|
5023
5050
|
"@bpinternal/jex": "^1.2.4",
|
|
5024
5051
|
"@bpinternal/yargs-extra": "^0.0.21",
|
|
@@ -6809,7 +6836,7 @@ ${names || " (none found)"}`);
|
|
|
6809
6836
|
async copyTemplateFiles(templateDir) {
|
|
6810
6837
|
const substitutions = {
|
|
6811
6838
|
"{{projectName}}": this.projectName,
|
|
6812
|
-
"{{runtimeVersion}}": "1.18.0
|
|
6839
|
+
"{{runtimeVersion}}": "1.18.0",
|
|
6813
6840
|
"{{packageManager}}": this.packageManager
|
|
6814
6841
|
};
|
|
6815
6842
|
await this.copyDirRecursive(templateDir, this.projectPath, substitutions);
|
|
@@ -7930,6 +7957,7 @@ import { existsSync as existsSync9 } from "fs";
|
|
|
7930
7957
|
import fs19 from "fs/promises";
|
|
7931
7958
|
import path42 from "path";
|
|
7932
7959
|
init_config_utils();
|
|
7960
|
+
init_operations();
|
|
7933
7961
|
|
|
7934
7962
|
// src/generators/plugin-types.ts
|
|
7935
7963
|
import { z as z4 } from "@botpress/sdk";
|
|
@@ -9916,7 +9944,14 @@ declare module "@botpress/runtime/_types/state" {
|
|
|
9916
9944
|
const configType = configurationType && configurationType !== "default" ? `, configurationType: "${configurationType}"` : "";
|
|
9917
9945
|
const mergedConfig = mergeIntegrationConfig(serverConfigResult.configs[alias], config);
|
|
9918
9946
|
const configData = Object.keys(mergedConfig).length > 0 ? `, configuration: ${JSON.stringify(mergedConfig)}` : "";
|
|
9919
|
-
|
|
9947
|
+
let enabled;
|
|
9948
|
+
if (integration.enabled !== undefined) {
|
|
9949
|
+
enabled = integration.enabled;
|
|
9950
|
+
} else if (serverConfigResult.error) {
|
|
9951
|
+
enabled = false;
|
|
9952
|
+
} else {
|
|
9953
|
+
enabled = resolveIntegrationEnabled(integration, serverConfigResult.enabledStates[alias]);
|
|
9954
|
+
}
|
|
9920
9955
|
addIntegrations.push(`bot.addIntegration(${importName}, { alias: "${alias}", enabled: ${enabled}${configType}${configData} });`);
|
|
9921
9956
|
}
|
|
9922
9957
|
const depRefErrors = PluginParser.validateDependencyReferences(project.dependencies || {});
|
|
@@ -13149,4 +13184,4 @@ export {
|
|
|
13149
13184
|
AgentProject
|
|
13150
13185
|
};
|
|
13151
13186
|
|
|
13152
|
-
//# debugId=
|
|
13187
|
+
//# debugId=F724F8B172DC2B5E64756E2164756E21
|