@botpress/adk 1.15.2 → 1.15.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.
|
@@ -3,16 +3,22 @@ import type { Dependencies } from './types';
|
|
|
3
3
|
* ConfigWriter handles writing updates to agent.config.ts
|
|
4
4
|
*
|
|
5
5
|
* Note: For reading dependencies, use AgentProject.dependencies instead.
|
|
6
|
-
* This class is only for surgical updates to
|
|
6
|
+
* This class is only for surgical updates to specific fields.
|
|
7
7
|
*/
|
|
8
8
|
export declare class ConfigWriter {
|
|
9
9
|
private configPath;
|
|
10
10
|
constructor(projectPath: string);
|
|
11
|
+
private loadConfig;
|
|
12
|
+
private saveConfig;
|
|
11
13
|
/**
|
|
12
14
|
* Updates the dependencies field in agent.config.ts
|
|
13
15
|
* Uses ts-morph to surgically update only the dependencies property
|
|
14
16
|
* while preserving all other config fields (name, models, state, etc.)
|
|
15
17
|
*/
|
|
16
18
|
updateDependencies(dependencies: Dependencies): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Updates the name field in agent.config.ts
|
|
21
|
+
*/
|
|
22
|
+
updateName(name: string): Promise<void>;
|
|
17
23
|
}
|
|
18
24
|
//# sourceMappingURL=config-writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/agent-project/config-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAQ;gBAEd,WAAW,EAAE,MAAM;IAI/B;;;;OAIG;IACG,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/agent-project/config-writer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAQ;gBAEd,WAAW,EAAE,MAAM;IAI/B,OAAO,CAAC,UAAU;YAoBJ,UAAU;IAQxB;;;;OAIG;IACG,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBnE;;OAEG;IACG,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAU9C"}
|
package/dist/index.js
CHANGED
|
@@ -651,7 +651,7 @@ var PRETTIER_CONFIG, formatCode = async (code, filepath) => {
|
|
|
651
651
|
`));
|
|
652
652
|
return code;
|
|
653
653
|
}
|
|
654
|
-
}, ADK_VERSION = "1.15.
|
|
654
|
+
}, ADK_VERSION = "1.15.3", relative2 = (from, to) => {
|
|
655
655
|
const fromDir = path10.dirname(from);
|
|
656
656
|
const relative3 = path10.relative(fromDir, to);
|
|
657
657
|
return relative3.startsWith(".") ? relative3 : `./${relative3}`;
|
|
@@ -794,7 +794,7 @@ var init_integration_action_types = __esm(() => {
|
|
|
794
794
|
var require_package = __commonJS((exports, module) => {
|
|
795
795
|
module.exports = {
|
|
796
796
|
name: "@botpress/adk",
|
|
797
|
-
version: "1.15.
|
|
797
|
+
version: "1.15.3",
|
|
798
798
|
description: "Core ADK library for building AI agents on Botpress",
|
|
799
799
|
type: "module",
|
|
800
800
|
main: "dist/index.js",
|
|
@@ -841,7 +841,7 @@ var require_package = __commonJS((exports, module) => {
|
|
|
841
841
|
"@botpress/cli": "^5.2.0",
|
|
842
842
|
"@botpress/client": "^1.35.0",
|
|
843
843
|
"@botpress/cognitive": "^0.3.14",
|
|
844
|
-
"@botpress/runtime": "^1.15.
|
|
844
|
+
"@botpress/runtime": "^1.15.3",
|
|
845
845
|
"@botpress/sdk": "^5.4.3",
|
|
846
846
|
"@bpinternal/jex": "^1.2.4",
|
|
847
847
|
"@bpinternal/yargs-extra": "^0.0.21",
|
|
@@ -3058,12 +3058,11 @@ class ConfigWriter {
|
|
|
3058
3058
|
constructor(projectPath) {
|
|
3059
3059
|
this.configPath = path11.join(projectPath, "agent.config.ts");
|
|
3060
3060
|
}
|
|
3061
|
-
|
|
3061
|
+
loadConfig() {
|
|
3062
3062
|
const project = new Project;
|
|
3063
3063
|
const sourceFile = project.addSourceFileAtPath(this.configPath);
|
|
3064
3064
|
const defineConfigCall = sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression).find((call) => {
|
|
3065
|
-
|
|
3066
|
-
return expression.getText() === "defineConfig";
|
|
3065
|
+
return call.getExpression().getText() === "defineConfig";
|
|
3067
3066
|
});
|
|
3068
3067
|
if (!defineConfigCall) {
|
|
3069
3068
|
throw new Error("Could not find defineConfig() call in agent.config.ts");
|
|
@@ -3072,10 +3071,17 @@ class ConfigWriter {
|
|
|
3072
3071
|
if (!configArg || !configArg.isKind(SyntaxKind.ObjectLiteralExpression)) {
|
|
3073
3072
|
throw new Error("defineConfig() must have an object literal as its first argument");
|
|
3074
3073
|
}
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3074
|
+
return { sourceFile, configObject: configArg };
|
|
3075
|
+
}
|
|
3076
|
+
async saveConfig(sourceFile) {
|
|
3077
|
+
sourceFile.formatText();
|
|
3078
|
+
const content = sourceFile.getFullText();
|
|
3079
|
+
const formatted = await formatCode(content, this.configPath);
|
|
3080
|
+
sourceFile.replaceWithText(formatted);
|
|
3081
|
+
await sourceFile.save();
|
|
3082
|
+
}
|
|
3083
|
+
async updateDependencies(dependencies) {
|
|
3084
|
+
const { sourceFile, configObject } = this.loadConfig();
|
|
3079
3085
|
let dependenciesProperty = configObject.getProperty("dependencies");
|
|
3080
3086
|
if (dependenciesProperty) {
|
|
3081
3087
|
dependenciesProperty.setInitializer(JSON.stringify(dependencies));
|
|
@@ -3085,11 +3091,15 @@ class ConfigWriter {
|
|
|
3085
3091
|
initializer: JSON.stringify(dependencies)
|
|
3086
3092
|
});
|
|
3087
3093
|
}
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
sourceFile.
|
|
3092
|
-
|
|
3094
|
+
await this.saveConfig(sourceFile);
|
|
3095
|
+
}
|
|
3096
|
+
async updateName(name) {
|
|
3097
|
+
const { sourceFile, configObject } = this.loadConfig();
|
|
3098
|
+
const nameProperty = configObject.getProperty("name");
|
|
3099
|
+
if (nameProperty) {
|
|
3100
|
+
nameProperty.setInitializer(`'${name.replace(/'/g, "\\'")}'`);
|
|
3101
|
+
}
|
|
3102
|
+
await this.saveConfig(sourceFile);
|
|
3093
3103
|
}
|
|
3094
3104
|
}
|
|
3095
3105
|
|
|
@@ -6393,7 +6403,7 @@ class AgentProjectGenerator {
|
|
|
6393
6403
|
deploy: "adk deploy"
|
|
6394
6404
|
},
|
|
6395
6405
|
dependencies: {
|
|
6396
|
-
"@botpress/runtime": `^${"1.15.
|
|
6406
|
+
"@botpress/runtime": `^${"1.15.3"}`
|
|
6397
6407
|
},
|
|
6398
6408
|
devDependencies: {
|
|
6399
6409
|
typescript: "^5.9.3"
|
|
@@ -11859,4 +11869,4 @@ export {
|
|
|
11859
11869
|
AgentProject
|
|
11860
11870
|
};
|
|
11861
11871
|
|
|
11862
|
-
//# debugId=
|
|
11872
|
+
//# debugId=AE3B528B2B7EDC6E64756E2164756E21
|